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();

                int sum = 0;
                
                for (int i= 0; i < M; i++) {
                	sum += scan.nextInt();
                }
                
                int holiday = N - sum;
                
                if (holiday < 0) {
                	holiday = -1;
                }
                
                System.out.println(holiday);
        }

} 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();

                int sum = 0;
                
                for (int i= 0; i < M; i++) {
                	sum += scan.nextInt();
                }
                
                int holiday = N - sum;
                
                if (holiday < 0) {
                	holiday = -1;
                }
                
                System.out.println(holiday);
        }

} Main public static void main(String[] args) {
                Scanner scan = new Scanner(System.in);

                int N = scan.nextInt();
                int M = scan.nextInt();

                int sum = 0;
                
                for (int i= 0; i < M; i++) {
                	sum += scan.nextInt();
                }
                
                int holiday = N - sum;
                
                if (holiday < 0) {
                	holiday = -1;
                }
                
                System.out.println(holiday);
        } main {
                Scanner scan = new Scanner(System.in);

                int N = scan.nextInt();
                int M = scan.nextInt();

                int sum = 0;
                
                for (int i= 0; i < M; i++) {
                	sum += scan.nextInt();
                }
                
                int holiday = N - sum;
                
                if (holiday < 0) {
                	holiday = -1;
                }
                
                System.out.println(holiday);
        } 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 int sum = 0; sum 0 for (int i= 0; i < M; i++) {
                	sum += scan.nextInt();
                } int i= 0; int i= 0; i 0 i < M i M i++ i++ i {
                	sum += scan.nextInt();
                } {
                	sum += scan.nextInt();
                } sum += scan.nextInt() sum scan.nextInt() scan.nextInt scan int holiday = N - sum; holiday N - sum N sum if (holiday < 0) {
                	holiday = -1;
                } holiday < 0 holiday 0 {
                	holiday = -1;
                } holiday = -1 holiday -1 1 System.out.println(holiday) System.out.println System.out System System.out holiday 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();

                int sum = 0;
                
                for (int i= 0; i < M; i++) {
                	sum += scan.nextInt();
                }
                
                int holiday = N - sum;
                
                if (holiday < 0) {
                	holiday = -1;
                }
                
                System.out.println(holiday);
        }

} public class Main {
        public static void main(String[] args) {
                Scanner scan = new Scanner(System.in);

                int N = scan.nextInt();
                int M = scan.nextInt();

                int sum = 0;
                
                for (int i= 0; i < M; i++) {
                	sum += scan.nextInt();
                }
                
                int holiday = N - sum;
                
                if (holiday < 0) {
                	holiday = -1;
                }
                
                System.out.println(holiday);
        }

} 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();

                int sum = 0;
                
                for (int i= 0; i < M; i++) {
                	sum += scan.nextInt();
                }
                
                int holiday = N - sum;
                
                if (holiday < 0) {
                	holiday = -1;
                }
                
                System.out.println(holiday);
        }

}