import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		long N = scn.nextInt();
		int M = scn.nextInt();
		long ans = N;
		for(int i = 0;i<M;i++) {
			ans -= scn.nextInt();
		}
		scn.close();
		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 scn = new Scanner(System.in);
		long N = scn.nextInt();
		int M = scn.nextInt();
		long ans = N;
		for(int i = 0;i<M;i++) {
			ans -= scn.nextInt();
		}
		scn.close();
		if(ans <= -1) {
			System.out.println(-1);
		} else {
			System.out.println(ans);
		}

	}

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

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

	} Scanner scn = new Scanner(System.in); scn new Scanner(System.in) long N = scn.nextInt(); N scn.nextInt() scn.nextInt scn int M = scn.nextInt(); M scn.nextInt() scn.nextInt scn long ans = N; ans N for(int i = 0;i<M;i++) {
			ans -= scn.nextInt();
		} int i = 0; int i = 0; i 0 i<M i M i++ i++ i {
			ans -= scn.nextInt();
		} {
			ans -= scn.nextInt();
		} ans -= scn.nextInt() ans scn.nextInt() scn.nextInt scn scn.close() scn.close scn 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 scn = new Scanner(System.in);
		long N = scn.nextInt();
		int M = scn.nextInt();
		long ans = N;
		for(int i = 0;i<M;i++) {
			ans -= scn.nextInt();
		}
		scn.close();
		if(ans <= -1) {
			System.out.println(-1);
		} else {
			System.out.println(ans);
		}

	}

} public class Main {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		long N = scn.nextInt();
		int M = scn.nextInt();
		long ans = N;
		for(int i = 0;i<M;i++) {
			ans -= scn.nextInt();
		}
		scn.close();
		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 scn = new Scanner(System.in);
		long N = scn.nextInt();
		int M = scn.nextInt();
		long ans = N;
		for(int i = 0;i<M;i++) {
			ans -= scn.nextInt();
		}
		scn.close();
		if(ans <= -1) {
			System.out.println(-1);
		} else {
			System.out.println(ans);
		}

	}

}
