본문 바로가기
Python

반복문 연습 - 25304

by soojitasan 2024. 6. 11. 21:12
## 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')