import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int working = 0;
		for (int i = 0; i < m; ++i) {
			working += sc.nextInt();
		}

		int vacation = Math.max(n - working, -1);
		System.out.println(vacation);
	}

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

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int working = 0;
		for (int i = 0; i < m; ++i) {
			working += sc.nextInt();
		}

		int vacation = Math.max(n - working, -1);
		System.out.println(vacation);
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int working = 0;
		for (int i = 0; i < m; ++i) {
			working += sc.nextInt();
		}

		int vacation = Math.max(n - working, -1);
		System.out.println(vacation);
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int working = 0;
		for (int i = 0; i < m; ++i) {
			working += sc.nextInt();
		}

		int vacation = Math.max(n - working, -1);
		System.out.println(vacation);
	} 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 working = 0; working 0 for (int i = 0; i < m; ++i) {
			working += sc.nextInt();
		} int i = 0; int i = 0; i 0 i < m i m ++i ++i i {
			working += sc.nextInt();
		} {
			working += sc.nextInt();
		} working += sc.nextInt() working sc.nextInt() sc.nextInt sc int vacation = Math.max(n - working, -1); vacation Math.max(n - working, -1) Math.max Math n - working n working -1 1 System.out.println(vacation) System.out.println System.out System System.out vacation String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int working = 0;
		for (int i = 0; i < m; ++i) {
			working += sc.nextInt();
		}

		int vacation = Math.max(n - working, -1);
		System.out.println(vacation);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int working = 0;
		for (int i = 0; i < m; ++i) {
			working += sc.nextInt();
		}

		int vacation = Math.max(n - working, -1);
		System.out.println(vacation);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int working = 0;
		for (int i = 0; i < m; ++i) {
			working += sc.nextInt();
		}

		int vacation = Math.max(n - working, -1);
		System.out.println(vacation);
	}

}
