import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int maxday = sc.nextInt();
		int task = sc.nextInt();
		int days = 0;
		for(int i = 0; i < task; i++){
			days += sc.nextInt();
		}
		maxday -= days;
		if(maxday < 0){
			maxday = -1;
		}
		System.out.println(maxday);
		
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int maxday = sc.nextInt();
		int task = sc.nextInt();
		int days = 0;
		for(int i = 0; i < task; i++){
			days += sc.nextInt();
		}
		maxday -= days;
		if(maxday < 0){
			maxday = -1;
		}
		System.out.println(maxday);
		
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int maxday = sc.nextInt();
		int task = sc.nextInt();
		int days = 0;
		for(int i = 0; i < task; i++){
			days += sc.nextInt();
		}
		maxday -= days;
		if(maxday < 0){
			maxday = -1;
		}
		System.out.println(maxday);
		
	} main {
		Scanner sc = new Scanner(System.in);
		int maxday = sc.nextInt();
		int task = sc.nextInt();
		int days = 0;
		for(int i = 0; i < task; i++){
			days += sc.nextInt();
		}
		maxday -= days;
		if(maxday < 0){
			maxday = -1;
		}
		System.out.println(maxday);
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int maxday = sc.nextInt(); maxday sc.nextInt() sc.nextInt sc int task = sc.nextInt(); task sc.nextInt() sc.nextInt sc int days = 0; days 0 for(int i = 0; i < task; i++){
			days += sc.nextInt();
		} int i = 0; int i = 0; i 0 i < task i task i++ i++ i {
			days += sc.nextInt();
		} {
			days += sc.nextInt();
		} days += sc.nextInt() days sc.nextInt() sc.nextInt sc maxday -= days maxday days if(maxday < 0){
			maxday = -1;
		} maxday < 0 maxday 0 {
			maxday = -1;
		} maxday = -1 maxday -1 1 System.out.println(maxday) System.out.println System.out System System.out maxday String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int maxday = sc.nextInt();
		int task = sc.nextInt();
		int days = 0;
		for(int i = 0; i < task; i++){
			days += sc.nextInt();
		}
		maxday -= days;
		if(maxday < 0){
			maxday = -1;
		}
		System.out.println(maxday);
		
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int maxday = sc.nextInt();
		int task = sc.nextInt();
		int days = 0;
		for(int i = 0; i < task; i++){
			days += sc.nextInt();
		}
		maxday -= days;
		if(maxday < 0){
			maxday = -1;
		}
		System.out.println(maxday);
		
	}
} Main
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int maxday = sc.nextInt();
		int task = sc.nextInt();
		int days = 0;
		for(int i = 0; i < task; i++){
			days += sc.nextInt();
		}
		maxday -= days;
		if(maxday < 0){
			maxday = -1;
		}
		System.out.println(maxday);
		
	}
}