#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int M, N, D = 0;
  cin >> M >> N;
  
  vector<int> A(M);
  for (int i = 0; i < M; i++) {
    cin >> A(i);
  }
  for (int i = 0; i < N; i++) {
    D += A(i);
  }
  if (D > N) {
    cout << "-1" << endl;
  }
  else {
    cout << N-D << endl;
  }
}