#include<iostream>
#include<vector>
using namespace std;
       int main()
  {   
     int n,h;
     cin>>n;
     cin>>h;
     vector<int>human;
     int temp;
     for(int i=0;i<n;i++)
     {   
         cin>>temp;
         human.push_back(temp);
     }
   int sum=0;
    for(auto x:human)
    {
        sum=sum+x;
    }
    
   if(sum>n)
     cout<<"-1"<<endl;
    if(sum==n)
    cout<<"0"<<endl;
       else
         cout<<n-sum<<endl;
  return 0;   
 }