import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int bill = scanner.nextInt();
int x = scanner.nextInt();
int sum = 0;
for (int i = 0; i < x; i++) {
int a = scanner.nextInt();
int b = scanner.nextInt();
sum = sum +a * b;
}
if (bill == sum) {
System.out.println("Yes");
} else {
System.out.println("No");
}
}
}
'코딩 테스트 > Python - 백준 단계별로 풀어보기' 카테고리의 다른 글
백준 15552번 자바 - 빠른 A + B (0) | 2024.04.12 |
---|---|
백준 25314번 자바 - 코딩은 체육과목입니다. (0) | 2024.04.12 |
백준 8393번 자바 - 합 (0) | 2024.04.11 |
백준 10950번 자바 - A+B - 3 (0) | 2024.04.10 |
백준 2739번 자바 - 구구단 (0) | 2024.04.10 |