
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define INF (long long)(1e9+7)
#define REP(i,n) for(ll i = 0; i < n; i++)
#define REP1(i,n) for(ll i = 1; i <= n; i++)

ll gcd(ll a, ll b)
{
  if(b == 0) return a;
  return gcd(b, a % b);
}

vector <ll> a;

int main(void)
{
  ll n, m;
  cin >> n >> m;
  ll sum = 0;
  REP(i, m) {
    ll a1;
    cin >> a1;
    sum += a1;
  }
  cout << (sum <= n ? n - sum : -1) << endl;

}
