
import java.util.Scanner;
public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
	    int n,m,hangout;
	    int assignment = 0;  // n days , m assingment
	 
	    n = sc.nextInt();
	    m = sc.nextInt();
	    
	    int[] arr = new int[m];
	    
	    for(int i = 0; i<m; i++) {
	    	arr[i] = sc.nextInt();
	    	assignment = assignment+arr[i];
	    }
	    hangout = n-assignment;
	    
	    
	    if(hangout>=0) {
	    	System.out.println(hangout);
	    }
	    else {
	    	System.out.println("-1");
	    }
	    
	    

	}

} import java.util.Scanner; Scanner java.util public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
	    int n,m,hangout;
	    int assignment = 0;  // n days , m assingment
	 
	    n = sc.nextInt();
	    m = sc.nextInt();
	    
	    int[] arr = new int[m];
	    
	    for(int i = 0; i<m; i++) {
	    	arr[i] = sc.nextInt();
	    	assignment = assignment+arr[i];
	    }
	    hangout = n-assignment;
	    
	    
	    if(hangout>=0) {
	    	System.out.println(hangout);
	    }
	    else {
	    	System.out.println("-1");
	    }
	    
	    

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
	    int n,m,hangout;
	    int assignment = 0;  // n days , m assingment
	 
	    n = sc.nextInt();
	    m = sc.nextInt();
	    
	    int[] arr = new int[m];
	    
	    for(int i = 0; i<m; i++) {
	    	arr[i] = sc.nextInt();
	    	assignment = assignment+arr[i];
	    }
	    hangout = n-assignment;
	    
	    
	    if(hangout>=0) {
	    	System.out.println(hangout);
	    }
	    else {
	    	System.out.println("-1");
	    }
	    
	    

	} main {
		Scanner sc = new Scanner(System.in);
		
	    int n,m,hangout;
	    int assignment = 0;  // n days , m assingment
	 
	    n = sc.nextInt();
	    m = sc.nextInt();
	    
	    int[] arr = new int[m];
	    
	    for(int i = 0; i<m; i++) {
	    	arr[i] = sc.nextInt();
	    	assignment = assignment+arr[i];
	    }
	    hangout = n-assignment;
	    
	    
	    if(hangout>=0) {
	    	System.out.println(hangout);
	    }
	    else {
	    	System.out.println("-1");
	    }
	    
	    

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n n m m hangout; hangout int assignment = 0; assignment 0 n = sc.nextInt() n sc.nextInt() sc.nextInt sc m = sc.nextInt() m sc.nextInt() sc.nextInt sc int[] arr = new int[m]; arr new int[m] m for(int i = 0; i<m; i++) {
	    	arr[i] = sc.nextInt();
	    	assignment = assignment+arr[i];
	    } int i = 0; int i = 0; i 0 i<m i m i++ i++ i {
	    	arr[i] = sc.nextInt();
	    	assignment = assignment+arr[i];
	    } {
	    	arr[i] = sc.nextInt();
	    	assignment = assignment+arr[i];
	    } arr[i] = sc.nextInt() arr[i] arr i sc.nextInt() sc.nextInt sc assignment = assignment+arr[i] assignment assignment+arr[i] assignment arr[i] arr i hangout = n-assignment hangout n-assignment n assignment if(hangout>=0) {
	    	System.out.println(hangout);
	    }
	    else {
	    	System.out.println("-1");
	    } hangout>=0 hangout 0 {
	    	System.out.println(hangout);
	    } System.out.println(hangout) System.out.println System.out System System.out hangout {
	    	System.out.println("-1");
	    } 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 sc = new Scanner(System.in);
		
	    int n,m,hangout;
	    int assignment = 0;  // n days , m assingment
	 
	    n = sc.nextInt();
	    m = sc.nextInt();
	    
	    int[] arr = new int[m];
	    
	    for(int i = 0; i<m; i++) {
	    	arr[i] = sc.nextInt();
	    	assignment = assignment+arr[i];
	    }
	    hangout = n-assignment;
	    
	    
	    if(hangout>=0) {
	    	System.out.println(hangout);
	    }
	    else {
	    	System.out.println("-1");
	    }
	    
	    

	}

} public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
	    int n,m,hangout;
	    int assignment = 0;  // n days , m assingment
	 
	    n = sc.nextInt();
	    m = sc.nextInt();
	    
	    int[] arr = new int[m];
	    
	    for(int i = 0; i<m; i++) {
	    	arr[i] = sc.nextInt();
	    	assignment = assignment+arr[i];
	    }
	    hangout = n-assignment;
	    
	    
	    if(hangout>=0) {
	    	System.out.println(hangout);
	    }
	    else {
	    	System.out.println("-1");
	    }
	    
	    

	}

} Main

import java.util.Scanner;
public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
	    int n,m,hangout;
	    int assignment = 0;  // n days , m assingment
	 
	    n = sc.nextInt();
	    m = sc.nextInt();
	    
	    int[] arr = new int[m];
	    
	    for(int i = 0; i<m; i++) {
	    	arr[i] = sc.nextInt();
	    	assignment = assignment+arr[i];
	    }
	    hangout = n-assignment;
	    
	    
	    if(hangout>=0) {
	    	System.out.println(hangout);
	    }
	    else {
	    	System.out.println("-1");
	    }
	    
	    

	}

}
