#include<bits/stdc++.h>
using namespace std;
int main(){
 int N, M;
 cin >> N >> M ;

 vector<int> work(M);
 for (int i = 0; i < M; i++){
 cin >> work.at(i);}
 if (N - work.at(i) >= 0){
 cout<< N - (work.at(i)) <<endl;
}
 else {
 cout >> -1 >> endl;
}

}
