import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner stdIn = new Scanner(System.in);

		int summerVacationCnt = stdIn.nextInt();
		int homeworkCnt = stdIn.nextInt();

		int resultCnt = summerVacationCnt;

		for (int i = 0; i < homeworkCnt; i++) {
			resultCnt -= stdIn.nextInt();
		}

		stdIn.close();

		System.out.println(resultCnt >= 0 ? resultCnt : -1);
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {

		Scanner stdIn = new Scanner(System.in);

		int summerVacationCnt = stdIn.nextInt();
		int homeworkCnt = stdIn.nextInt();

		int resultCnt = summerVacationCnt;

		for (int i = 0; i < homeworkCnt; i++) {
			resultCnt -= stdIn.nextInt();
		}

		stdIn.close();

		System.out.println(resultCnt >= 0 ? resultCnt : -1);
	}

} Main public static void main(String[] args) {

		Scanner stdIn = new Scanner(System.in);

		int summerVacationCnt = stdIn.nextInt();
		int homeworkCnt = stdIn.nextInt();

		int resultCnt = summerVacationCnt;

		for (int i = 0; i < homeworkCnt; i++) {
			resultCnt -= stdIn.nextInt();
		}

		stdIn.close();

		System.out.println(resultCnt >= 0 ? resultCnt : -1);
	} main {

		Scanner stdIn = new Scanner(System.in);

		int summerVacationCnt = stdIn.nextInt();
		int homeworkCnt = stdIn.nextInt();

		int resultCnt = summerVacationCnt;

		for (int i = 0; i < homeworkCnt; i++) {
			resultCnt -= stdIn.nextInt();
		}

		stdIn.close();

		System.out.println(resultCnt >= 0 ? resultCnt : -1);
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int summerVacationCnt = stdIn.nextInt(); summerVacationCnt stdIn.nextInt() stdIn.nextInt stdIn int homeworkCnt = stdIn.nextInt(); homeworkCnt stdIn.nextInt() stdIn.nextInt stdIn int resultCnt = summerVacationCnt; resultCnt summerVacationCnt for (int i = 0; i < homeworkCnt; i++) {
			resultCnt -= stdIn.nextInt();
		} int i = 0; int i = 0; i 0 i < homeworkCnt i homeworkCnt i++ i++ i {
			resultCnt -= stdIn.nextInt();
		} {
			resultCnt -= stdIn.nextInt();
		} resultCnt -= stdIn.nextInt() resultCnt stdIn.nextInt() stdIn.nextInt stdIn stdIn.close() stdIn.close stdIn System.out.println(resultCnt >= 0 ? resultCnt : -1) System.out.println System.out System System.out resultCnt >= 0 ? resultCnt : -1 resultCnt >= 0 resultCnt 0 resultCnt -1 1 String[] args args public class Main {
	public static void main(String[] args) {

		Scanner stdIn = new Scanner(System.in);

		int summerVacationCnt = stdIn.nextInt();
		int homeworkCnt = stdIn.nextInt();

		int resultCnt = summerVacationCnt;

		for (int i = 0; i < homeworkCnt; i++) {
			resultCnt -= stdIn.nextInt();
		}

		stdIn.close();

		System.out.println(resultCnt >= 0 ? resultCnt : -1);
	}

} public class Main {
	public static void main(String[] args) {

		Scanner stdIn = new Scanner(System.in);

		int summerVacationCnt = stdIn.nextInt();
		int homeworkCnt = stdIn.nextInt();

		int resultCnt = summerVacationCnt;

		for (int i = 0; i < homeworkCnt; i++) {
			resultCnt -= stdIn.nextInt();
		}

		stdIn.close();

		System.out.println(resultCnt >= 0 ? resultCnt : -1);
	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner stdIn = new Scanner(System.in);

		int summerVacationCnt = stdIn.nextInt();
		int homeworkCnt = stdIn.nextInt();

		int resultCnt = summerVacationCnt;

		for (int i = 0; i < homeworkCnt; i++) {
			resultCnt -= stdIn.nextInt();
		}

		stdIn.close();

		System.out.println(resultCnt >= 0 ? resultCnt : -1);
	}

}
