import java.util.*;
public class Main {

    public static void main(String[] args) {
        Scanner  yomi = new Scanner(System.in);
        int n = yomi.nextInt();
        int m = yomi.nextInt();
        int a = 0;
        for (int i =0;i<m;i++){
            a += yomi.nextInt();
        }
        System.out.println(n-a>=0 ? n-a : -1);

    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner  yomi = new Scanner(System.in);
        int n = yomi.nextInt();
        int m = yomi.nextInt();
        int a = 0;
        for (int i =0;i<m;i++){
            a += yomi.nextInt();
        }
        System.out.println(n-a>=0 ? n-a : -1);

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

    } main {
        Scanner  yomi = new Scanner(System.in);
        int n = yomi.nextInt();
        int m = yomi.nextInt();
        int a = 0;
        for (int i =0;i<m;i++){
            a += yomi.nextInt();
        }
        System.out.println(n-a>=0 ? n-a : -1);

    } Scanner  yomi = new Scanner(System.in); yomi new Scanner(System.in) int n = yomi.nextInt(); n yomi.nextInt() yomi.nextInt yomi int m = yomi.nextInt(); m yomi.nextInt() yomi.nextInt yomi int a = 0; a 0 for (int i =0;i<m;i++){
            a += yomi.nextInt();
        } int i =0; int i =0; i 0 i<m i m i++ i++ i {
            a += yomi.nextInt();
        } {
            a += yomi.nextInt();
        } a += yomi.nextInt() a yomi.nextInt() yomi.nextInt yomi System.out.println(n-a>=0 ? n-a : -1) System.out.println System.out System System.out n-a>=0 ? n-a : -1 n-a>=0 n-a n a 0 n-a n a -1 1 String[] args args public class Main {

    public static void main(String[] args) {
        Scanner  yomi = new Scanner(System.in);
        int n = yomi.nextInt();
        int m = yomi.nextInt();
        int a = 0;
        for (int i =0;i<m;i++){
            a += yomi.nextInt();
        }
        System.out.println(n-a>=0 ? n-a : -1);

    }
} public class Main {

    public static void main(String[] args) {
        Scanner  yomi = new Scanner(System.in);
        int n = yomi.nextInt();
        int m = yomi.nextInt();
        int a = 0;
        for (int i =0;i<m;i++){
            a += yomi.nextInt();
        }
        System.out.println(n-a>=0 ? n-a : -1);

    }
} Main
import java.util.*;
public class Main {

    public static void main(String[] args) {
        Scanner  yomi = new Scanner(System.in);
        int n = yomi.nextInt();
        int m = yomi.nextInt();
        int a = 0;
        for (int i =0;i<m;i++){
            a += yomi.nextInt();
        }
        System.out.println(n-a>=0 ? n-a : -1);

    }
}