//
//  second.cpp
//  CoderTest
//
//  Created by yuya on 2019/07/25.
//  Copyright © 2019 yuya. All rights reserved.
//

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
#define all(x) (x).begin(), (x).end()
#define rep(i,n) for(int (i) = 0; (i) < (int)(n); i++)
#define rep1(i,n) for(int (i) = 1; (i) <= (int)(n); i++)
#define INF 1000000
#define MOD 998244353



int main()
{
    int N,M;
    cin >> N >> M;
    
    int sum=0,A;
    rep(i, M) {
        cin >> A;
        sum += A;
    }
    
    if (sum <= N) {
        cout << N-sum << endl;
    } else{ cout << -1 << endl;}
    
    
    
    return 0;
}


