import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
 
        Scanner scanner = new Scanner(System.in);
 
        int vacation = scanner.nextInt();
        int homeworkNumber = scanner.nextInt();
        int[] daysSpentInHomework = new int[homeworkNumber];
        int studyDay = 0;
 
        for (int i = 0; i < homeworkNumber; i++) {
            studyDay += scanner.nextInt();
        }
 
        int playable;
      
        playable = vacation - studyDay;
 
        if (playable >= 0) {
            
            System.out.println(playable);
        } else {
            System.out.println("-1");
        }
 
        scanner.close();
 
    }
 
} import java.util.Scanner; Scanner java.util public class Main {
 
    public static void main(String[] args) {
 
        Scanner scanner = new Scanner(System.in);
 
        int vacation = scanner.nextInt();
        int homeworkNumber = scanner.nextInt();
        int[] daysSpentInHomework = new int[homeworkNumber];
        int studyDay = 0;
 
        for (int i = 0; i < homeworkNumber; i++) {
            studyDay += scanner.nextInt();
        }
 
        int playable;
      
        playable = vacation - studyDay;
 
        if (playable >= 0) {
            
            System.out.println(playable);
        } else {
            System.out.println("-1");
        }
 
        scanner.close();
 
    }
 
} Main public static void main(String[] args) {
 
        Scanner scanner = new Scanner(System.in);
 
        int vacation = scanner.nextInt();
        int homeworkNumber = scanner.nextInt();
        int[] daysSpentInHomework = new int[homeworkNumber];
        int studyDay = 0;
 
        for (int i = 0; i < homeworkNumber; i++) {
            studyDay += scanner.nextInt();
        }
 
        int playable;
      
        playable = vacation - studyDay;
 
        if (playable >= 0) {
            
            System.out.println(playable);
        } else {
            System.out.println("-1");
        }
 
        scanner.close();
 
    } main {
 
        Scanner scanner = new Scanner(System.in);
 
        int vacation = scanner.nextInt();
        int homeworkNumber = scanner.nextInt();
        int[] daysSpentInHomework = new int[homeworkNumber];
        int studyDay = 0;
 
        for (int i = 0; i < homeworkNumber; i++) {
            studyDay += scanner.nextInt();
        }
 
        int playable;
      
        playable = vacation - studyDay;
 
        if (playable >= 0) {
            
            System.out.println(playable);
        } else {
            System.out.println("-1");
        }
 
        scanner.close();
 
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int vacation = scanner.nextInt(); vacation scanner.nextInt() scanner.nextInt scanner int homeworkNumber = scanner.nextInt(); homeworkNumber scanner.nextInt() scanner.nextInt scanner int[] daysSpentInHomework = new int[homeworkNumber]; daysSpentInHomework new int[homeworkNumber] homeworkNumber int studyDay = 0; studyDay 0 for (int i = 0; i < homeworkNumber; i++) {
            studyDay += scanner.nextInt();
        } int i = 0; int i = 0; i 0 i < homeworkNumber i homeworkNumber i++ i++ i {
            studyDay += scanner.nextInt();
        } {
            studyDay += scanner.nextInt();
        } studyDay += scanner.nextInt() studyDay scanner.nextInt() scanner.nextInt scanner int playable; playable playable = vacation - studyDay playable vacation - studyDay vacation studyDay if (playable >= 0) {
            
            System.out.println(playable);
        } else {
            System.out.println("-1");
        } playable >= 0 playable 0 {
            
            System.out.println(playable);
        } System.out.println(playable) System.out.println System.out System System.out playable {
            System.out.println("-1");
        } System.out.println("-1") System.out.println System.out System System.out "-1" scanner.close() scanner.close scanner String[] args args public class Main {
 
    public static void main(String[] args) {
 
        Scanner scanner = new Scanner(System.in);
 
        int vacation = scanner.nextInt();
        int homeworkNumber = scanner.nextInt();
        int[] daysSpentInHomework = new int[homeworkNumber];
        int studyDay = 0;
 
        for (int i = 0; i < homeworkNumber; i++) {
            studyDay += scanner.nextInt();
        }
 
        int playable;
      
        playable = vacation - studyDay;
 
        if (playable >= 0) {
            
            System.out.println(playable);
        } else {
            System.out.println("-1");
        }
 
        scanner.close();
 
    }
 
} public class Main {
 
    public static void main(String[] args) {
 
        Scanner scanner = new Scanner(System.in);
 
        int vacation = scanner.nextInt();
        int homeworkNumber = scanner.nextInt();
        int[] daysSpentInHomework = new int[homeworkNumber];
        int studyDay = 0;
 
        for (int i = 0; i < homeworkNumber; i++) {
            studyDay += scanner.nextInt();
        }
 
        int playable;
      
        playable = vacation - studyDay;
 
        if (playable >= 0) {
            
            System.out.println(playable);
        } else {
            System.out.println("-1");
        }
 
        scanner.close();
 
    }
 
} Main
import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
 
        Scanner scanner = new Scanner(System.in);
 
        int vacation = scanner.nextInt();
        int homeworkNumber = scanner.nextInt();
        int[] daysSpentInHomework = new int[homeworkNumber];
        int studyDay = 0;
 
        for (int i = 0; i < homeworkNumber; i++) {
            studyDay += scanner.nextInt();
        }
 
        int playable;
      
        playable = vacation - studyDay;
 
        if (playable >= 0) {
            
            System.out.println(playable);
        } else {
            System.out.println("-1");
        }
 
        scanner.close();
 
    }
 
}