문제설명

 

소스코드

#include<iostream>
using namespace std;
int main()
{
	int input; int input2;
	cin >> input >> input2;
	int sub = input; int tmp = input2;
	for (int i = 0; i < tmp; ++i)
	{
		cin >> input >> input2;
		sub -= input * input2;
	}
	if (sub == 0) cout << "Yes" << endl;
	else cout << "No" << endl;
}