#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n,m;

    cin >> n >> n;

    int sum = 0;

    for (int i = 0; i < m; i++)
    {
        int ai;
        cin >> ai;
        sum += ai;
    }

    if(n < sum) cout << "-2" << endl;
    else cout << n - sum << endl;
    
    return 0;
}