import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        long totalTime=scan.nextLong();
        long n=scan.nextLong();
        for (long i = 0; i <n ; i++) {
            totalTime-=scan.nextLong();
        }
        System.out.println(Math.max(totalTime,-1));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        long totalTime=scan.nextLong();
        long n=scan.nextLong();
        for (long i = 0; i <n ; i++) {
            totalTime-=scan.nextLong();
        }
        System.out.println(Math.max(totalTime,-1));
    }
} Main public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        long totalTime=scan.nextLong();
        long n=scan.nextLong();
        for (long i = 0; i <n ; i++) {
            totalTime-=scan.nextLong();
        }
        System.out.println(Math.max(totalTime,-1));
    } main {
        Scanner scan=new Scanner(System.in);
        long totalTime=scan.nextLong();
        long n=scan.nextLong();
        for (long i = 0; i <n ; i++) {
            totalTime-=scan.nextLong();
        }
        System.out.println(Math.max(totalTime,-1));
    } Scanner scan=new Scanner(System.in); scan new Scanner(System.in) long totalTime=scan.nextLong(); totalTime scan.nextLong() scan.nextLong scan long n=scan.nextLong(); n scan.nextLong() scan.nextLong scan for (long i = 0; i <n ; i++) {
            totalTime-=scan.nextLong();
        } long i = 0; long i = 0; i 0 i <n i n i++ i++ i {
            totalTime-=scan.nextLong();
        } {
            totalTime-=scan.nextLong();
        } totalTime-=scan.nextLong() totalTime scan.nextLong() scan.nextLong scan System.out.println(Math.max(totalTime,-1)) System.out.println System.out System System.out Math.max(totalTime,-1) Math.max Math totalTime -1 1 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        long totalTime=scan.nextLong();
        long n=scan.nextLong();
        for (long i = 0; i <n ; i++) {
            totalTime-=scan.nextLong();
        }
        System.out.println(Math.max(totalTime,-1));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        long totalTime=scan.nextLong();
        long n=scan.nextLong();
        for (long i = 0; i <n ; i++) {
            totalTime-=scan.nextLong();
        }
        System.out.println(Math.max(totalTime,-1));
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        long totalTime=scan.nextLong();
        long n=scan.nextLong();
        for (long i = 0; i <n ; i++) {
            totalTime-=scan.nextLong();
        }
        System.out.println(Math.max(totalTime,-1));
    }
}
