import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int homeworks = sc.nextInt();
        int days = 0;
        for (int i = 0; i < homeworks; i++) days += sc.nextInt();
        System.out.println(Math.max(-1, n - days));
    }
} 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 homeworks = sc.nextInt();
        int days = 0;
        for (int i = 0; i < homeworks; i++) days += sc.nextInt();
        System.out.println(Math.max(-1, n - days));
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int homeworks = sc.nextInt();
        int days = 0;
        for (int i = 0; i < homeworks; i++) days += sc.nextInt();
        System.out.println(Math.max(-1, n - days));
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int homeworks = sc.nextInt();
        int days = 0;
        for (int i = 0; i < homeworks; i++) days += sc.nextInt();
        System.out.println(Math.max(-1, n - days));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int homeworks = sc.nextInt(); homeworks sc.nextInt() sc.nextInt sc int days = 0; days 0 for (int i = 0; i < homeworks; i++) days += sc.nextInt(); int i = 0; int i = 0; i 0 i < homeworks i homeworks i++ i++ i days += sc.nextInt(); days += sc.nextInt() days sc.nextInt() sc.nextInt sc System.out.println(Math.max(-1, n - days)) System.out.println System.out System System.out Math.max(-1, n - days) Math.max Math -1 1 n - days n days String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int homeworks = sc.nextInt();
        int days = 0;
        for (int i = 0; i < homeworks; i++) days += sc.nextInt();
        System.out.println(Math.max(-1, n - days));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int homeworks = sc.nextInt();
        int days = 0;
        for (int i = 0; i < homeworks; i++) days += sc.nextInt();
        System.out.println(Math.max(-1, n - days));
    }
} 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 homeworks = sc.nextInt();
        int days = 0;
        for (int i = 0; i < homeworks; i++) days += sc.nextInt();
        System.out.println(Math.max(-1, n - days));
    }
}