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 cnt=0;
		while(m-->0) {
			int a=scan.nextInt();
			cnt+=a;
		}
		if(n-cnt>=0) System.out.println(n-cnt);
		else System.out.println("-1");
	}

} 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 cnt=0;
		while(m-->0) {
			int a=scan.nextInt();
			cnt+=a;
		}
		if(n-cnt>=0) System.out.println(n-cnt);
		else System.out.println("-1");
	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n=scan.nextInt();
		int m=scan.nextInt();
		int cnt=0;
		while(m-->0) {
			int a=scan.nextInt();
			cnt+=a;
		}
		if(n-cnt>=0) System.out.println(n-cnt);
		else System.out.println("-1");
	} main {
		Scanner scan = new Scanner(System.in);
		int n=scan.nextInt();
		int m=scan.nextInt();
		int cnt=0;
		while(m-->0) {
			int a=scan.nextInt();
			cnt+=a;
		}
		if(n-cnt>=0) System.out.println(n-cnt);
		else System.out.println("-1");
	} 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 cnt=0; cnt 0 while(m-->0) {
			int a=scan.nextInt();
			cnt+=a;
		} m-->0 m-- m 0 {
			int a=scan.nextInt();
			cnt+=a;
		} int a=scan.nextInt(); a scan.nextInt() scan.nextInt scan cnt+=a cnt a if(n-cnt>=0) System.out.println(n-cnt);
		else System.out.println("-1"); n-cnt>=0 n-cnt n cnt 0 System.out.println(n-cnt) System.out.println System.out System System.out n-cnt n cnt System.out.println("-1") System.out.println System.out System System.out "-1" 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 cnt=0;
		while(m-->0) {
			int a=scan.nextInt();
			cnt+=a;
		}
		if(n-cnt>=0) System.out.println(n-cnt);
		else System.out.println("-1");
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n=scan.nextInt();
		int m=scan.nextInt();
		int cnt=0;
		while(m-->0) {
			int a=scan.nextInt();
			cnt+=a;
		}
		if(n-cnt>=0) System.out.println(n-cnt);
		else System.out.println("-1");
	}

} 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 cnt=0;
		while(m-->0) {
			int a=scan.nextInt();
			cnt+=a;
		}
		if(n-cnt>=0) System.out.println(n-cnt);
		else System.out.println("-1");
	}

}
