728x90
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int bil = sc.nextInt();
int many = sc.nextInt();
for(int i=0; i<many; i++){
int price = sc.nextInt();
int count = sc.nextInt();
bil = bil -(price*count);
}
if(bil == 0 ) System.out.println("Yes");
else System.out.println("No");
}
}
728x90
'Coding Practice > BAEKJOON - Java' 카테고리의 다른 글
[BAEKJOON] 11022번 (1) | 2023.03.25 |
---|---|
[BAEKJOON] 25314번 (0) | 2023.03.22 |
[BAEKJOON] 2480번 (0) | 2023.03.20 |
[BAEKJOON] 2525번 (0) | 2023.03.11 |
[BAEKJOON] 2884번 (0) | 2023.03.10 |