#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
ll n, m, x, s;
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> m;
    while(m--)
        cin >> x, s += x;
    cout << max(-1LL, n - s);
    return 0;
}
