## 25304 영수증
x = int(input()) ## 총금액
n = int(input()) ## 물건 종류
tot = list()
for i in range (1, n+1):
a, b = input().split()
a = int(a)
b = int(b)
tot_i = a*b
tot.append(tot_i)
if x == sum(tot):
print('Yes')
else:
print('No')
Python/코테 연습