#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;

int main() {
  int N, M;
  cin >> N >> M;
  rep(i, M) {
    int a;
    cin >> a;
    N -= a;
  }
  cout << max(-1, N) << endl;
  return 0;
}
