
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();
        int M = scanner.nextInt();

        int A = 0;
        for (int i = 0 ; i < M ; i++) {
            A += scanner.nextInt();
        }

        System.out.println(Math.max(N - A, -1));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();
        int M = scanner.nextInt();

        int A = 0;
        for (int i = 0 ; i < M ; i++) {
            A += scanner.nextInt();
        }

        System.out.println(Math.max(N - A, -1));
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();
        int M = scanner.nextInt();

        int A = 0;
        for (int i = 0 ; i < M ; i++) {
            A += scanner.nextInt();
        }

        System.out.println(Math.max(N - A, -1));
    } main {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();
        int M = scanner.nextInt();

        int A = 0;
        for (int i = 0 ; i < M ; i++) {
            A += scanner.nextInt();
        }

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

        int N = scanner.nextInt();
        int M = scanner.nextInt();

        int A = 0;
        for (int i = 0 ; i < M ; i++) {
            A += scanner.nextInt();
        }

        System.out.println(Math.max(N - A, -1));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();
        int M = scanner.nextInt();

        int A = 0;
        for (int i = 0 ; i < M ; i++) {
            A += scanner.nextInt();
        }

        System.out.println(Math.max(N - A, -1));
    }
} Main

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int N = scanner.nextInt();
        int M = scanner.nextInt();

        int A = 0;
        for (int i = 0 ; i < M ; i++) {
            A += scanner.nextInt();
        }

        System.out.println(Math.max(N - A, -1));
    }
}
