#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <string>

int N, M;
std::vector<int> A;
long long ans;

int main() {
  std::cin >> N >> M;
  A.assign(M, 0);
  for (int i = 0; i < M; ++i) {
    std::cin >> A[i];
    ans -= A[i];
  }
  ans += N;
  if (ans >= 0) {
    std::cout << ans << std::endl;
  } else {
    std::cout << -1 << std::endl;
  }
}