import java.util.Scanner;

public class Main{
  	public static void main(String[] args){
  		Scanner sc = new Scanner(System.in);
  		int N = sc.nextInt();
  		int M = sc.nextInt();
  		int sum = 0;
  		for(int i = 0; i < M; i++){
  	    	int A = sc.nextInt();
  	    	sum += A;
    	}
  		int freeDays = N - sum;
  		if(freeDays < 0){
  	    	freeDays = -1;
    	}
  		System.out.println(freeDays);
    }
} import java.util.Scanner; Scanner java.util public class Main{
  	public static void main(String[] args){
  		Scanner sc = new Scanner(System.in);
  		int N = sc.nextInt();
  		int M = sc.nextInt();
  		int sum = 0;
  		for(int i = 0; i < M; i++){
  	    	int A = sc.nextInt();
  	    	sum += A;
    	}
  		int freeDays = N - sum;
  		if(freeDays < 0){
  	    	freeDays = -1;
    	}
  		System.out.println(freeDays);
    }
} Main public static void main(String[] args){
  		Scanner sc = new Scanner(System.in);
  		int N = sc.nextInt();
  		int M = sc.nextInt();
  		int sum = 0;
  		for(int i = 0; i < M; i++){
  	    	int A = sc.nextInt();
  	    	sum += A;
    	}
  		int freeDays = N - sum;
  		if(freeDays < 0){
  	    	freeDays = -1;
    	}
  		System.out.println(freeDays);
    } main {
  		Scanner sc = new Scanner(System.in);
  		int N = sc.nextInt();
  		int M = sc.nextInt();
  		int sum = 0;
  		for(int i = 0; i < M; i++){
  	    	int A = sc.nextInt();
  	    	sum += A;
    	}
  		int freeDays = N - sum;
  		if(freeDays < 0){
  	    	freeDays = -1;
    	}
  		System.out.println(freeDays);
    } Scanner sc = new Scanner(System.in); sc 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 sum = 0; sum 0 for(int i = 0; i < M; i++){
  	    	int A = sc.nextInt();
  	    	sum += A;
    	} int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
  	    	int A = sc.nextInt();
  	    	sum += A;
    	} {
  	    	int A = sc.nextInt();
  	    	sum += A;
    	} int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc sum += A sum A int freeDays = N - sum; freeDays N - sum N sum if(freeDays < 0){
  	    	freeDays = -1;
    	} freeDays < 0 freeDays 0 {
  	    	freeDays = -1;
    	} freeDays = -1 freeDays -1 1 System.out.println(freeDays) System.out.println System.out System System.out freeDays String[] args args public class Main{
  	public static void main(String[] args){
  		Scanner sc = new Scanner(System.in);
  		int N = sc.nextInt();
  		int M = sc.nextInt();
  		int sum = 0;
  		for(int i = 0; i < M; i++){
  	    	int A = sc.nextInt();
  	    	sum += A;
    	}
  		int freeDays = N - sum;
  		if(freeDays < 0){
  	    	freeDays = -1;
    	}
  		System.out.println(freeDays);
    }
} public class Main{
  	public static void main(String[] args){
  		Scanner sc = new Scanner(System.in);
  		int N = sc.nextInt();
  		int M = sc.nextInt();
  		int sum = 0;
  		for(int i = 0; i < M; i++){
  	    	int A = sc.nextInt();
  	    	sum += A;
    	}
  		int freeDays = N - sum;
  		if(freeDays < 0){
  	    	freeDays = -1;
    	}
  		System.out.println(freeDays);
    }
} Main
import java.util.Scanner;

public class Main{
  	public static void main(String[] args){
  		Scanner sc = new Scanner(System.in);
  		int N = sc.nextInt();
  		int M = sc.nextInt();
  		int sum = 0;
  		for(int i = 0; i < M; i++){
  	    	int A = sc.nextInt();
  	    	sum += A;
    	}
  		int freeDays = N - sum;
  		if(freeDays < 0){
  	    	freeDays = -1;
    	}
  		System.out.println(freeDays);
    }
}