import java.util.*;
import java.io.*;
import java.lang.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner (System.in);
		int n = sc.nextInt(); int m = sc.nextInt(); int homeworkDays = 0;
		int[] arr = new int[m];
		while (m-- > 0) {
			arr[m] = sc.nextInt();
			homeworkDays+=arr[m];
		}
			int vacation = n-homeworkDays;
			System.out.println(vacation >= 0 ? vacation : "-1");
	}
} import java.util.*; util.* java import java.io.*; io.* java import java.lang.*; lang.* java public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner (System.in);
		int n = sc.nextInt(); int m = sc.nextInt(); int homeworkDays = 0;
		int[] arr = new int[m];
		while (m-- > 0) {
			arr[m] = sc.nextInt();
			homeworkDays+=arr[m];
		}
			int vacation = n-homeworkDays;
			System.out.println(vacation >= 0 ? vacation : "-1");
	}
} Main public static void main (String[] args) {
		Scanner sc = new Scanner (System.in);
		int n = sc.nextInt(); int m = sc.nextInt(); int homeworkDays = 0;
		int[] arr = new int[m];
		while (m-- > 0) {
			arr[m] = sc.nextInt();
			homeworkDays+=arr[m];
		}
			int vacation = n-homeworkDays;
			System.out.println(vacation >= 0 ? vacation : "-1");
	} main {
		Scanner sc = new Scanner (System.in);
		int n = sc.nextInt(); int m = sc.nextInt(); int homeworkDays = 0;
		int[] arr = new int[m];
		while (m-- > 0) {
			arr[m] = sc.nextInt();
			homeworkDays+=arr[m];
		}
			int vacation = n-homeworkDays;
			System.out.println(vacation >= 0 ? vacation : "-1");
	} Scanner sc = new Scanner (System.in); sc new Scanner (System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int homeworkDays = 0; homeworkDays 0 int[] arr = new int[m]; arr new int[m] m while (m-- > 0) {
			arr[m] = sc.nextInt();
			homeworkDays+=arr[m];
		} m-- > 0 m-- m 0 {
			arr[m] = sc.nextInt();
			homeworkDays+=arr[m];
		} arr[m] = sc.nextInt() arr[m] arr m sc.nextInt() sc.nextInt sc homeworkDays+=arr[m] homeworkDays arr[m] arr m int vacation = n-homeworkDays; vacation n-homeworkDays n homeworkDays System.out.println(vacation >= 0 ? vacation : "-1") System.out.println System.out System System.out vacation >= 0 ? vacation : "-1" vacation >= 0 vacation 0 vacation "-1" String[] args args public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner (System.in);
		int n = sc.nextInt(); int m = sc.nextInt(); int homeworkDays = 0;
		int[] arr = new int[m];
		while (m-- > 0) {
			arr[m] = sc.nextInt();
			homeworkDays+=arr[m];
		}
			int vacation = n-homeworkDays;
			System.out.println(vacation >= 0 ? vacation : "-1");
	}
} public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner (System.in);
		int n = sc.nextInt(); int m = sc.nextInt(); int homeworkDays = 0;
		int[] arr = new int[m];
		while (m-- > 0) {
			arr[m] = sc.nextInt();
			homeworkDays+=arr[m];
		}
			int vacation = n-homeworkDays;
			System.out.println(vacation >= 0 ? vacation : "-1");
	}
} Main
import java.util.*;
import java.io.*;
import java.lang.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner (System.in);
		int n = sc.nextInt(); int m = sc.nextInt(); int homeworkDays = 0;
		int[] arr = new int[m];
		while (m-- > 0) {
			arr[m] = sc.nextInt();
			homeworkDays+=arr[m];
		}
			int vacation = n-homeworkDays;
			System.out.println(vacation >= 0 ? vacation : "-1");
	}
}
