import java.util.Scanner;


public class Main {

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

	}

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

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

	}

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

	} main {
		Scanner scan = new Scanner(System.in);
		int days = scan.nextInt();
		int total = scan.nextInt();
		int count = 0;
		for(int i=0;i<total;i++){
			count+= scan.nextInt();
		}
		days -= count;
		if(days<0)
			System.out.println(-1);
		else
			System.out.println(days);

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

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

	}

} public class Main {

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

	}

} Main
import java.util.Scanner;


public class Main {

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

	}

}
