#include <iostream>

using namespace std;

int main() {
    int a;
    cin >> a;
    int n;
    cin >> n;
    int arrr = 0;
    int arr[n];
    int ar[n];
    for (int i = 0;i < n ;i++ ) {
        cin >> arr[i] >> ar[i];
        arrr += arr[i] * ar[i];
    }
    if (a == arrr) {
        cout << "Yes";
    }
    else{
        cout << "No";
    }
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: