import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int N = input.nextInt();
        int M = input.nextInt();
        int[] A = new int[M];
        for (int i = 0; i < M; i++){
            A[i] = input.nextInt();
        }
        int ans = N;
        for (int i = 0; i < M; i++){
            ans -= A[i];
        }
        System.out.println(Math.max(-1,ans));
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int N = input.nextInt();
        int M = input.nextInt();
        int[] A = new int[M];
        for (int i = 0; i < M; i++){
            A[i] = input.nextInt();
        }
        int ans = N;
        for (int i = 0; i < M; i++){
            ans -= A[i];
        }
        System.out.println(Math.max(-1,ans));
    }
} Main public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int N = input.nextInt();
        int M = input.nextInt();
        int[] A = new int[M];
        for (int i = 0; i < M; i++){
            A[i] = input.nextInt();
        }
        int ans = N;
        for (int i = 0; i < M; i++){
            ans -= A[i];
        }
        System.out.println(Math.max(-1,ans));
    } main {
        Scanner input = new Scanner(System.in);
        int N = input.nextInt();
        int M = input.nextInt();
        int[] A = new int[M];
        for (int i = 0; i < M; i++){
            A[i] = input.nextInt();
        }
        int ans = N;
        for (int i = 0; i < M; i++){
            ans -= A[i];
        }
        System.out.println(Math.max(-1,ans));
    } Scanner input = new Scanner(System.in); input new Scanner(System.in) int N = input.nextInt(); N input.nextInt() input.nextInt input int M = input.nextInt(); M input.nextInt() input.nextInt input int[] A = new int[M]; A new int[M] M for (int i = 0; i < M; i++){
            A[i] = input.nextInt();
        } int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
            A[i] = input.nextInt();
        } {
            A[i] = input.nextInt();
        } A[i] = input.nextInt() A[i] A i input.nextInt() input.nextInt input int ans = N; ans N for (int i = 0; i < M; i++){
            ans -= A[i];
        } int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
            ans -= A[i];
        } {
            ans -= A[i];
        } ans -= A[i] ans A[i] A i System.out.println(Math.max(-1,ans)) System.out.println System.out System System.out Math.max(-1,ans) Math.max Math -1 1 ans String[] args args public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int N = input.nextInt();
        int M = input.nextInt();
        int[] A = new int[M];
        for (int i = 0; i < M; i++){
            A[i] = input.nextInt();
        }
        int ans = N;
        for (int i = 0; i < M; i++){
            ans -= A[i];
        }
        System.out.println(Math.max(-1,ans));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int N = input.nextInt();
        int M = input.nextInt();
        int[] A = new int[M];
        for (int i = 0; i < M; i++){
            A[i] = input.nextInt();
        }
        int ans = N;
        for (int i = 0; i < M; i++){
            ans -= A[i];
        }
        System.out.println(Math.max(-1,ans));
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int N = input.nextInt();
        int M = input.nextInt();
        int[] A = new int[M];
        for (int i = 0; i < M; i++){
            A[i] = input.nextInt();
        }
        int ans = N;
        for (int i = 0; i < M; i++){
            ans -= A[i];
        }
        System.out.println(Math.max(-1,ans));
    }
}