#include<bits/stdc++.h>

using namespace std;


int main(){
    int n,m,cnt;
    cin>>n>>m;
    int  a[m];
    for(int i=0;i<m;i++){cin>>a[i];}
    int sum=accumulate(a,a+m,0);
    if(n<m){cout<<"-1"<<endl;}
    else{cout<<n-sum;}
    return 0;
    }