import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int N=scan.nextInt();
		int M=scan.nextInt();
		int A[]=new int[M];
		for(int i=0;i<M;i++) {
			A[i]=scan.nextInt();
		}
		int day=0;
		for(int i=0;i<M;i++) {
			day+=A[i];
		}
		if(N-day<0) {
			System.out.println("-1");
		}
		else {
			System.out.println(N-day);
		}

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int N=scan.nextInt();
		int M=scan.nextInt();
		int A[]=new int[M];
		for(int i=0;i<M;i++) {
			A[i]=scan.nextInt();
		}
		int day=0;
		for(int i=0;i<M;i++) {
			day+=A[i];
		}
		if(N-day<0) {
			System.out.println("-1");
		}
		else {
			System.out.println(N-day);
		}

	}

} Main public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int N=scan.nextInt();
		int M=scan.nextInt();
		int A[]=new int[M];
		for(int i=0;i<M;i++) {
			A[i]=scan.nextInt();
		}
		int day=0;
		for(int i=0;i<M;i++) {
			day+=A[i];
		}
		if(N-day<0) {
			System.out.println("-1");
		}
		else {
			System.out.println(N-day);
		}

	} main {
		Scanner scan=new Scanner(System.in);
		int N=scan.nextInt();
		int M=scan.nextInt();
		int A[]=new int[M];
		for(int i=0;i<M;i++) {
			A[i]=scan.nextInt();
		}
		int day=0;
		for(int i=0;i<M;i++) {
			day+=A[i];
		}
		if(N-day<0) {
			System.out.println("-1");
		}
		else {
			System.out.println(N-day);
		}

	} Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int N=scan.nextInt(); N scan.nextInt() scan.nextInt scan int M=scan.nextInt(); M scan.nextInt() scan.nextInt scan int A[]=new int[M]; A new int[M] M for(int i=0;i<M;i++) {
			A[i]=scan.nextInt();
		} int i=0; int i=0; i 0 i<M i M i++ i++ i {
			A[i]=scan.nextInt();
		} {
			A[i]=scan.nextInt();
		} A[i]=scan.nextInt() A[i] A i scan.nextInt() scan.nextInt scan int day=0; day 0 for(int i=0;i<M;i++) {
			day+=A[i];
		} int i=0; int i=0; i 0 i<M i M i++ i++ i {
			day+=A[i];
		} {
			day+=A[i];
		} day+=A[i] day A[i] A i if(N-day<0) {
			System.out.println("-1");
		}
		else {
			System.out.println(N-day);
		} N-day<0 N-day N day 0 {
			System.out.println("-1");
		} System.out.println("-1") System.out.println System.out System System.out "-1" {
			System.out.println(N-day);
		} System.out.println(N-day) System.out.println System.out System System.out N-day N day String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int N=scan.nextInt();
		int M=scan.nextInt();
		int A[]=new int[M];
		for(int i=0;i<M;i++) {
			A[i]=scan.nextInt();
		}
		int day=0;
		for(int i=0;i<M;i++) {
			day+=A[i];
		}
		if(N-day<0) {
			System.out.println("-1");
		}
		else {
			System.out.println(N-day);
		}

	}

} public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int N=scan.nextInt();
		int M=scan.nextInt();
		int A[]=new int[M];
		for(int i=0;i<M;i++) {
			A[i]=scan.nextInt();
		}
		int day=0;
		for(int i=0;i<M;i++) {
			day+=A[i];
		}
		if(N-day<0) {
			System.out.println("-1");
		}
		else {
			System.out.println(N-day);
		}

	}

} Main
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int N=scan.nextInt();
		int M=scan.nextInt();
		int A[]=new int[M];
		for(int i=0;i<M;i++) {
			A[i]=scan.nextInt();
		}
		int day=0;
		for(int i=0;i<M;i++) {
			day+=A[i];
		}
		if(N-day<0) {
			System.out.println("-1");
		}
		else {
			System.out.println(N-day);
		}

	}

}