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

int main()
{
    int n,m;
    cin>>n>>m;
    int arr[m],sum=0;
    for(int i=0;i<m;i++)
    {
        cin>>arr[i];
        sum+=arr[i];
    }
    int out=-1;
    if(sum<=n)
    {
        out=n-sum;
    }
    cout<<out<<endl;
    return 0;

}

