#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;
    long long sum = 0, a;
    for (int i = 0; i < m; i++) {
        cin >> a;
        sum += a;
    }
    if (n - sum > 0) cout << n - sum << "\n";
    else puts("-1");
}
