import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int m = kb.nextInt();
		for (int i = 0; i < m; i++) {
			int j = kb.nextInt();
			n -= j;
		}
		if (n >= 0) {
			System.out.println(n);
		} else {
			System.out.println(-1);
		}
		kb.close();
	}

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

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int m = kb.nextInt();
		for (int i = 0; i < m; i++) {
			int j = kb.nextInt();
			n -= j;
		}
		if (n >= 0) {
			System.out.println(n);
		} else {
			System.out.println(-1);
		}
		kb.close();
	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int m = kb.nextInt();
		for (int i = 0; i < m; i++) {
			int j = kb.nextInt();
			n -= j;
		}
		if (n >= 0) {
			System.out.println(n);
		} else {
			System.out.println(-1);
		}
		kb.close();
	} main {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int m = kb.nextInt();
		for (int i = 0; i < m; i++) {
			int j = kb.nextInt();
			n -= j;
		}
		if (n >= 0) {
			System.out.println(n);
		} else {
			System.out.println(-1);
		}
		kb.close();
	} Scanner kb = new Scanner(System.in); kb new Scanner(System.in) int n = kb.nextInt(); n kb.nextInt() kb.nextInt kb int m = kb.nextInt(); m kb.nextInt() kb.nextInt kb for (int i = 0; i < m; i++) {
			int j = kb.nextInt();
			n -= j;
		} int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
			int j = kb.nextInt();
			n -= j;
		} {
			int j = kb.nextInt();
			n -= j;
		} int j = kb.nextInt(); j kb.nextInt() kb.nextInt kb n -= j n j if (n >= 0) {
			System.out.println(n);
		} else {
			System.out.println(-1);
		} n >= 0 n 0 {
			System.out.println(n);
		} System.out.println(n) System.out.println System.out System System.out n {
			System.out.println(-1);
		} System.out.println(-1) System.out.println System.out System System.out -1 1 kb.close() kb.close kb String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int m = kb.nextInt();
		for (int i = 0; i < m; i++) {
			int j = kb.nextInt();
			n -= j;
		}
		if (n >= 0) {
			System.out.println(n);
		} else {
			System.out.println(-1);
		}
		kb.close();
	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int m = kb.nextInt();
		for (int i = 0; i < m; i++) {
			int j = kb.nextInt();
			n -= j;
		}
		if (n >= 0) {
			System.out.println(n);
		} else {
			System.out.println(-1);
		}
		kb.close();
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int m = kb.nextInt();
		for (int i = 0; i < m; i++) {
			int j = kb.nextInt();
			n -= j;
		}
		if (n >= 0) {
			System.out.println(n);
		} else {
			System.out.println(-1);
		}
		kb.close();
	}

}
