import sys
sys.stdin = open("input.txt","rt")
total = int(input())
cnt = int(input())
each_total = 0
for i in range(cnt):
a,b = map(int, input().split())
each_total += (a*b)
if each_total == total:
print("Yes")
else:
print("No")
백준문제풀이/반복문
댓글