import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        for(int i=0; i<M; i++) {
            N -= scan.nextInt();
        }
        System.out.println(N>=0?N:-1);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        for(int i=0; i<M; i++) {
            N -= scan.nextInt();
        }
        System.out.println(N>=0?N:-1);
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        for(int i=0; i<M; i++) {
            N -= scan.nextInt();
        }
        System.out.println(N>=0?N:-1);
    } main {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        for(int i=0; i<M; i++) {
            N -= scan.nextInt();
        }
        System.out.println(N>=0?N:-1);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int M = scan.nextInt(); M scan.nextInt() scan.nextInt scan for(int i=0; i<M; i++) {
            N -= scan.nextInt();
        } int i=0; int i=0; i 0 i<M i M i++ i++ i {
            N -= scan.nextInt();
        } {
            N -= scan.nextInt();
        } N -= scan.nextInt() N scan.nextInt() scan.nextInt scan System.out.println(N>=0?N:-1) System.out.println System.out System System.out N>=0?N:-1 N>=0 N 0 N -1 1 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        for(int i=0; i<M; i++) {
            N -= scan.nextInt();
        }
        System.out.println(N>=0?N:-1);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        for(int i=0; i<M; i++) {
            N -= scan.nextInt();
        }
        System.out.println(N>=0?N:-1);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        for(int i=0; i<M; i++) {
            N -= scan.nextInt();
        }
        System.out.println(N>=0?N:-1);
    }
}