import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
 
public class Main {
    public static void main(String args[]) throws IOException {
	Scanner scanner = new Scanner(System.in);
	int summer = scanner.nextInt();
	//宿題の数
	int num = scanner.nextInt();
	//計算用
      int tmp = 0;
      
	for(int i=0;i<num;i++){
        tmp += scanner.nextInt();
	}
	
    int day = summer - tmp;
      
    if(day>=0){
      System.out.println(day);
    }else{
       System.out.println(-1);
    }
      
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.*; util.* java public class Main {
    public static void main(String args[]) throws IOException {
	Scanner scanner = new Scanner(System.in);
	int summer = scanner.nextInt();
	//宿題の数
	int num = scanner.nextInt();
	//計算用
      int tmp = 0;
      
	for(int i=0;i<num;i++){
        tmp += scanner.nextInt();
	}
	
    int day = summer - tmp;
      
    if(day>=0){
      System.out.println(day);
    }else{
       System.out.println(-1);
    }
      
    }
} Main public static void main(String args[]) throws IOException {
	Scanner scanner = new Scanner(System.in);
	int summer = scanner.nextInt();
	//宿題の数
	int num = scanner.nextInt();
	//計算用
      int tmp = 0;
      
	for(int i=0;i<num;i++){
        tmp += scanner.nextInt();
	}
	
    int day = summer - tmp;
      
    if(day>=0){
      System.out.println(day);
    }else{
       System.out.println(-1);
    }
      
    } main {
	Scanner scanner = new Scanner(System.in);
	int summer = scanner.nextInt();
	//宿題の数
	int num = scanner.nextInt();
	//計算用
      int tmp = 0;
      
	for(int i=0;i<num;i++){
        tmp += scanner.nextInt();
	}
	
    int day = summer - tmp;
      
    if(day>=0){
      System.out.println(day);
    }else{
       System.out.println(-1);
    }
      
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int summer = scanner.nextInt(); summer scanner.nextInt() scanner.nextInt scanner int num = scanner.nextInt(); num scanner.nextInt() scanner.nextInt scanner int tmp = 0; tmp 0 for(int i=0;i<num;i++){
        tmp += scanner.nextInt();
	} int i=0; int i=0; i 0 i<num i num i++ i++ i {
        tmp += scanner.nextInt();
	} {
        tmp += scanner.nextInt();
	} tmp += scanner.nextInt() tmp scanner.nextInt() scanner.nextInt scanner int day = summer - tmp; day summer - tmp summer tmp if(day>=0){
      System.out.println(day);
    }else{
       System.out.println(-1);
    } day>=0 day 0 {
      System.out.println(day);
    } System.out.println(day) System.out.println System.out System System.out day {
       System.out.println(-1);
    } System.out.println(-1) System.out.println System.out System System.out -1 1 String args[] args public class Main {
    public static void main(String args[]) throws IOException {
	Scanner scanner = new Scanner(System.in);
	int summer = scanner.nextInt();
	//宿題の数
	int num = scanner.nextInt();
	//計算用
      int tmp = 0;
      
	for(int i=0;i<num;i++){
        tmp += scanner.nextInt();
	}
	
    int day = summer - tmp;
      
    if(day>=0){
      System.out.println(day);
    }else{
       System.out.println(-1);
    }
      
    }
} public class Main {
    public static void main(String args[]) throws IOException {
	Scanner scanner = new Scanner(System.in);
	int summer = scanner.nextInt();
	//宿題の数
	int num = scanner.nextInt();
	//計算用
      int tmp = 0;
      
	for(int i=0;i<num;i++){
        tmp += scanner.nextInt();
	}
	
    int day = summer - tmp;
      
    if(day>=0){
      System.out.println(day);
    }else{
       System.out.println(-1);
    }
      
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
 
public class Main {
    public static void main(String args[]) throws IOException {
	Scanner scanner = new Scanner(System.in);
	int summer = scanner.nextInt();
	//宿題の数
	int num = scanner.nextInt();
	//計算用
      int tmp = 0;
      
	for(int i=0;i<num;i++){
        tmp += scanner.nextInt();
	}
	
    int day = summer - tmp;
      
    if(day>=0){
      System.out.println(day);
    }else{
       System.out.println(-1);
    }
      
    }
}