import java.util.*;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int X  = keyboard.nextInt();
		int Y  = keyboard.nextInt();
		
		int HW = 0;
		
		for(int i=0; i<Y; i++) {
			HW += keyboard.nextInt();
		}
		
		int P = -1;
		if(X - HW >= 0) {
			P = X - HW;
		}
		
		System.out.println(P);
		keyboard.close();	
	}
} import java.util.*; util.* java public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int X  = keyboard.nextInt();
		int Y  = keyboard.nextInt();
		
		int HW = 0;
		
		for(int i=0; i<Y; i++) {
			HW += keyboard.nextInt();
		}
		
		int P = -1;
		if(X - HW >= 0) {
			P = X - HW;
		}
		
		System.out.println(P);
		keyboard.close();	
	}
} Main public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int X  = keyboard.nextInt();
		int Y  = keyboard.nextInt();
		
		int HW = 0;
		
		for(int i=0; i<Y; i++) {
			HW += keyboard.nextInt();
		}
		
		int P = -1;
		if(X - HW >= 0) {
			P = X - HW;
		}
		
		System.out.println(P);
		keyboard.close();	
	} main {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int X  = keyboard.nextInt();
		int Y  = keyboard.nextInt();
		
		int HW = 0;
		
		for(int i=0; i<Y; i++) {
			HW += keyboard.nextInt();
		}
		
		int P = -1;
		if(X - HW >= 0) {
			P = X - HW;
		}
		
		System.out.println(P);
		keyboard.close();	
	} Scanner keyboard = new Scanner(System.in); keyboard new Scanner(System.in) int X  = keyboard.nextInt(); X keyboard.nextInt() keyboard.nextInt keyboard int Y  = keyboard.nextInt(); Y keyboard.nextInt() keyboard.nextInt keyboard int HW = 0; HW 0 for(int i=0; i<Y; i++) {
			HW += keyboard.nextInt();
		} int i=0; int i=0; i 0 i<Y i Y i++ i++ i {
			HW += keyboard.nextInt();
		} {
			HW += keyboard.nextInt();
		} HW += keyboard.nextInt() HW keyboard.nextInt() keyboard.nextInt keyboard int P = -1; P -1 1 if(X - HW >= 0) {
			P = X - HW;
		} X - HW >= 0 X - HW X HW 0 {
			P = X - HW;
		} P = X - HW P X - HW X HW System.out.println(P) System.out.println System.out System System.out P keyboard.close() keyboard.close keyboard String[] args args public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int X  = keyboard.nextInt();
		int Y  = keyboard.nextInt();
		
		int HW = 0;
		
		for(int i=0; i<Y; i++) {
			HW += keyboard.nextInt();
		}
		
		int P = -1;
		if(X - HW >= 0) {
			P = X - HW;
		}
		
		System.out.println(P);
		keyboard.close();	
	}
} public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int X  = keyboard.nextInt();
		int Y  = keyboard.nextInt();
		
		int HW = 0;
		
		for(int i=0; i<Y; i++) {
			HW += keyboard.nextInt();
		}
		
		int P = -1;
		if(X - HW >= 0) {
			P = X - HW;
		}
		
		System.out.println(P);
		keyboard.close();	
	}
} Main
import java.util.*;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int X  = keyboard.nextInt();
		int Y  = keyboard.nextInt();
		
		int HW = 0;
		
		for(int i=0; i<Y; i++) {
			HW += keyboard.nextInt();
		}
		
		int P = -1;
		if(X - HW >= 0) {
			P = X - HW;
		}
		
		System.out.println(P);
		keyboard.close();	
	}
}
