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 ans = N;

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

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

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

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

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

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

		for (int i = 0; i < M; i++){
			int A = scan.nextInt();
			ans -= A;
		}
		if (ans < -1){
			System.out.println(-1);
		}else {
			System.out.println(ans);
		}
	}
}