import java.util.Scanner;
//int[] date=new int[2];
public class Main {
int i,o,sum,h,s,e,u,ty,yu,ui,n,num,qw;
double m,t,r,j,k,f,d,g,w;
static double l;
String b,c,z,x,v,a,q;
Scanner scan =new Scanner(System.in);
//入力
	public void input() {	
	
	}
	//演算
	public void compute() {
	
		}
//出力
	public void output() {
	int[]	date=new int[2];
		for(o=0;o<2;o++) {
		date[o]=scan.nextInt();
		}
		int[] dat=new int[date[1]];
		for(h=0;h<date[1];h++) {
			dat[h]=scan.nextInt();
			sum+=dat[h];
		}
		if(date[0]-sum>-1) {
			System.out.println(date[0]-sum);
		}else {
			System.out.println("-1");
		}
		}
	public static void main(String [ ] args) {
		Main p = new  Main ();
		p.input();
		p.compute();
		p.output();
		}
	} import java.util.Scanner; Scanner java.util public class Main {
int i,o,sum,h,s,e,u,ty,yu,ui,n,num,qw;
double m,t,r,j,k,f,d,g,w;
static double l;
String b,c,z,x,v,a,q;
Scanner scan =new Scanner(System.in);
//入力
	public void input() {	
	
	}
	//演算
	public void compute() {
	
		}
//出力
	public void output() {
	int[]	date=new int[2];
		for(o=0;o<2;o++) {
		date[o]=scan.nextInt();
		}
		int[] dat=new int[date[1]];
		for(h=0;h<date[1];h++) {
			dat[h]=scan.nextInt();
			sum+=dat[h];
		}
		if(date[0]-sum>-1) {
			System.out.println(date[0]-sum);
		}else {
			System.out.println("-1");
		}
		}
	public static void main(String [ ] args) {
		Main p = new  Main ();
		p.input();
		p.compute();
		p.output();
		}
	} Main int i i o o sum sum h h s s e e u u ty ty yu yu ui ui n n num num qw; qw double m m t t r r j j k k f f d d g g w; w static double l; l String b b c c z z x x v v a a q; q Scanner scan =new Scanner(System.in); scan new Scanner(System.in) //入力
	public void input() {	
	
	} input {	
	
	} //演算
	public void compute() {
	
		} compute {
	
		} //出力
	public void output() {
	int[]	date=new int[2];
		for(o=0;o<2;o++) {
		date[o]=scan.nextInt();
		}
		int[] dat=new int[date[1]];
		for(h=0;h<date[1];h++) {
			dat[h]=scan.nextInt();
			sum+=dat[h];
		}
		if(date[0]-sum>-1) {
			System.out.println(date[0]-sum);
		}else {
			System.out.println("-1");
		}
		} output {
	int[]	date=new int[2];
		for(o=0;o<2;o++) {
		date[o]=scan.nextInt();
		}
		int[] dat=new int[date[1]];
		for(h=0;h<date[1];h++) {
			dat[h]=scan.nextInt();
			sum+=dat[h];
		}
		if(date[0]-sum>-1) {
			System.out.println(date[0]-sum);
		}else {
			System.out.println("-1");
		}
		} int[]	date=new int[2]; date new int[2] 2 for(o=0;o<2;o++) {
		date[o]=scan.nextInt();
		} o=0; o=0 o 0 o<2 o 2 o++ o++ o {
		date[o]=scan.nextInt();
		} {
		date[o]=scan.nextInt();
		} date[o]=scan.nextInt() date[o] date o scan.nextInt() scan.nextInt scan int[] dat=new int[date[1]]; dat new int[date[1]] date[1] date 1 for(h=0;h<date[1];h++) {
			dat[h]=scan.nextInt();
			sum+=dat[h];
		} h=0; h=0 h 0 h<date[1] h date[1] date 1 h++ h++ h {
			dat[h]=scan.nextInt();
			sum+=dat[h];
		} {
			dat[h]=scan.nextInt();
			sum+=dat[h];
		} dat[h]=scan.nextInt() dat[h] dat h scan.nextInt() scan.nextInt scan sum+=dat[h] sum dat[h] dat h if(date[0]-sum>-1) {
			System.out.println(date[0]-sum);
		}else {
			System.out.println("-1");
		} date[0]-sum>-1 date[0]-sum date[0] date 0 sum -1 1 {
			System.out.println(date[0]-sum);
		} System.out.println(date[0]-sum) System.out.println System.out System System.out date[0]-sum date[0] date 0 sum {
			System.out.println("-1");
		} System.out.println("-1") System.out.println System.out System System.out "-1" public static void main(String [ ] args) {
		Main p = new  Main ();
		p.input();
		p.compute();
		p.output();
		} main {
		Main p = new  Main ();
		p.input();
		p.compute();
		p.output();
		} Main p = new  Main (); p new  Main () p.input() p.input p p.compute() p.compute p p.output() p.output p String [ ] args args public class Main {
int i,o,sum,h,s,e,u,ty,yu,ui,n,num,qw;
double m,t,r,j,k,f,d,g,w;
static double l;
String b,c,z,x,v,a,q;
Scanner scan =new Scanner(System.in);
//入力
	public void input() {	
	
	}
	//演算
	public void compute() {
	
		}
//出力
	public void output() {
	int[]	date=new int[2];
		for(o=0;o<2;o++) {
		date[o]=scan.nextInt();
		}
		int[] dat=new int[date[1]];
		for(h=0;h<date[1];h++) {
			dat[h]=scan.nextInt();
			sum+=dat[h];
		}
		if(date[0]-sum>-1) {
			System.out.println(date[0]-sum);
		}else {
			System.out.println("-1");
		}
		}
	public static void main(String [ ] args) {
		Main p = new  Main ();
		p.input();
		p.compute();
		p.output();
		}
	} public class Main {
int i,o,sum,h,s,e,u,ty,yu,ui,n,num,qw;
double m,t,r,j,k,f,d,g,w;
static double l;
String b,c,z,x,v,a,q;
Scanner scan =new Scanner(System.in);
//入力
	public void input() {	
	
	}
	//演算
	public void compute() {
	
		}
//出力
	public void output() {
	int[]	date=new int[2];
		for(o=0;o<2;o++) {
		date[o]=scan.nextInt();
		}
		int[] dat=new int[date[1]];
		for(h=0;h<date[1];h++) {
			dat[h]=scan.nextInt();
			sum+=dat[h];
		}
		if(date[0]-sum>-1) {
			System.out.println(date[0]-sum);
		}else {
			System.out.println("-1");
		}
		}
	public static void main(String [ ] args) {
		Main p = new  Main ();
		p.input();
		p.compute();
		p.output();
		}
	} Main
import java.util.Scanner;
//int[] date=new int[2];
public class Main {
int i,o,sum,h,s,e,u,ty,yu,ui,n,num,qw;
double m,t,r,j,k,f,d,g,w;
static double l;
String b,c,z,x,v,a,q;
Scanner scan =new Scanner(System.in);
//入力
	public void input() {	
	
	}
	//演算
	public void compute() {
	
		}
//出力
	public void output() {
	int[]	date=new int[2];
		for(o=0;o<2;o++) {
		date[o]=scan.nextInt();
		}
		int[] dat=new int[date[1]];
		for(h=0;h<date[1];h++) {
			dat[h]=scan.nextInt();
			sum+=dat[h];
		}
		if(date[0]-sum>-1) {
			System.out.println(date[0]-sum);
		}else {
			System.out.println("-1");
		}
		}
	public static void main(String [ ] args) {
		Main p = new  Main ();
		p.input();
		p.compute();
		p.output();
		}
	}