import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			

			int n = sc.nextInt();
			int m = sc.nextInt();
			
			int hw = 0;
			for(int i = 0 ; i < m ; i++ ) {
				hw += sc.nextInt();
			}
			
			int left = n - hw;
			
			System.out.println(left >= 0 ? left : -1);
			
			
		}
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			

			int n = sc.nextInt();
			int m = sc.nextInt();
			
			int hw = 0;
			for(int i = 0 ; i < m ; i++ ) {
				hw += sc.nextInt();
			}
			
			int left = n - hw;
			
			System.out.println(left >= 0 ? left : -1);
			
			
		}
	}

} Main public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			

			int n = sc.nextInt();
			int m = sc.nextInt();
			
			int hw = 0;
			for(int i = 0 ; i < m ; i++ ) {
				hw += sc.nextInt();
			}
			
			int left = n - hw;
			
			System.out.println(left >= 0 ? left : -1);
			
			
		}
	} main {
		try(Scanner sc = new Scanner(System.in)) {
			

			int n = sc.nextInt();
			int m = sc.nextInt();
			
			int hw = 0;
			for(int i = 0 ; i < m ; i++ ) {
				hw += sc.nextInt();
			}
			
			int left = n - hw;
			
			System.out.println(left >= 0 ? left : -1);
			
			
		}
	} try(Scanner sc = new Scanner(System.in)) {
			

			int n = sc.nextInt();
			int m = sc.nextInt();
			
			int hw = 0;
			for(int i = 0 ; i < m ; i++ ) {
				hw += sc.nextInt();
			}
			
			int left = n - hw;
			
			System.out.println(left >= 0 ? left : -1);
			
			
		} {
			

			int n = sc.nextInt();
			int m = sc.nextInt();
			
			int hw = 0;
			for(int i = 0 ; i < m ; i++ ) {
				hw += sc.nextInt();
			}
			
			int left = n - hw;
			
			System.out.println(left >= 0 ? left : -1);
			
			
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int hw = 0; hw 0 for(int i = 0 ; i < m ; i++ ) {
				hw += sc.nextInt();
			} int i = 0 ; int i = 0 ; i 0 i < m i m i++ i++ i {
				hw += sc.nextInt();
			} {
				hw += sc.nextInt();
			} hw += sc.nextInt() hw sc.nextInt() sc.nextInt sc int left = n - hw; left n - hw n hw System.out.println(left >= 0 ? left : -1) System.out.println System.out System System.out left >= 0 ? left : -1 left >= 0 left 0 left -1 1 String[] args args public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			

			int n = sc.nextInt();
			int m = sc.nextInt();
			
			int hw = 0;
			for(int i = 0 ; i < m ; i++ ) {
				hw += sc.nextInt();
			}
			
			int left = n - hw;
			
			System.out.println(left >= 0 ? left : -1);
			
			
		}
	}

} public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			

			int n = sc.nextInt();
			int m = sc.nextInt();
			
			int hw = 0;
			for(int i = 0 ; i < m ; i++ ) {
				hw += sc.nextInt();
			}
			
			int left = n - hw;
			
			System.out.println(left >= 0 ? left : -1);
			
			
		}
	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			

			int n = sc.nextInt();
			int m = sc.nextInt();
			
			int hw = 0;
			for(int i = 0 ; i < m ; i++ ) {
				hw += sc.nextInt();
			}
			
			int left = n - hw;
			
			System.out.println(left >= 0 ? left : -1);
			
			
		}
	}

}