#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = (long long)1000000007 * 1000000007;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int A, B;
int a[10010][10010], b[1000];
int dp[10010][3];
int main() {
  int N, M;
  cin >> N >> M;
  int A;
  for (int i = 0; i < (int)(M); i++) {
    cin >> A;
    N -= A;
  }
  cout << max(N, -1) << endl;
  return 0;
}
