#include<stdio.h>
#include<stdlib.h>
#define ll long long 
ll max(ll a,ll b){return a>b?a:b;}
int main(){
    ll n, m, i;
    scanf("%lld%lld",&n,&m);
    ll a[n];
    for(ll i = 0; i < m; i++)
        scanf("%lld",&a[i]);
    ll sum = 0;
    for(ll i = 0; i < m; i++)
        sum += a[i];
    printf("%lld\n",max(-1, n- sum));
    return 0;
}