import java.util.Scanner;
public class Main {
	public static void main(String[] args){

//	入力の読み込み
		Scanner sc = new Scanner(System.in);
		int natsuyasumi = sc.nextInt();
		int kazu = sc.nextInt();
		int shukudaiyaruhi = 0;

//	宿題の数分、宿題やる日を宿題番号分だけ増やす
		for(int i=0 ; i<kazu ; i++) {
			int bangou = sc.nextInt();
			shukudaiyaruhi += bangou;
		}

//	遊べる日数が0日以上かどうか判断
		if(natsuyasumi-shukudaiyaruhi>=0) {
			System.out.print(natsuyasumi-shukudaiyaruhi);
		}
		else {
			System.out.print(-1);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){

//	入力の読み込み
		Scanner sc = new Scanner(System.in);
		int natsuyasumi = sc.nextInt();
		int kazu = sc.nextInt();
		int shukudaiyaruhi = 0;

//	宿題の数分、宿題やる日を宿題番号分だけ増やす
		for(int i=0 ; i<kazu ; i++) {
			int bangou = sc.nextInt();
			shukudaiyaruhi += bangou;
		}

//	遊べる日数が0日以上かどうか判断
		if(natsuyasumi-shukudaiyaruhi>=0) {
			System.out.print(natsuyasumi-shukudaiyaruhi);
		}
		else {
			System.out.print(-1);
		}
	}
} Main public static void main(String[] args){

//	入力の読み込み
		Scanner sc = new Scanner(System.in);
		int natsuyasumi = sc.nextInt();
		int kazu = sc.nextInt();
		int shukudaiyaruhi = 0;

//	宿題の数分、宿題やる日を宿題番号分だけ増やす
		for(int i=0 ; i<kazu ; i++) {
			int bangou = sc.nextInt();
			shukudaiyaruhi += bangou;
		}

//	遊べる日数が0日以上かどうか判断
		if(natsuyasumi-shukudaiyaruhi>=0) {
			System.out.print(natsuyasumi-shukudaiyaruhi);
		}
		else {
			System.out.print(-1);
		}
	} main {

//	入力の読み込み
		Scanner sc = new Scanner(System.in);
		int natsuyasumi = sc.nextInt();
		int kazu = sc.nextInt();
		int shukudaiyaruhi = 0;

//	宿題の数分、宿題やる日を宿題番号分だけ増やす
		for(int i=0 ; i<kazu ; i++) {
			int bangou = sc.nextInt();
			shukudaiyaruhi += bangou;
		}

//	遊べる日数が0日以上かどうか判断
		if(natsuyasumi-shukudaiyaruhi>=0) {
			System.out.print(natsuyasumi-shukudaiyaruhi);
		}
		else {
			System.out.print(-1);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int natsuyasumi = sc.nextInt(); natsuyasumi sc.nextInt() sc.nextInt sc int kazu = sc.nextInt(); kazu sc.nextInt() sc.nextInt sc int shukudaiyaruhi = 0; shukudaiyaruhi 0 for(int i=0 ; i<kazu ; i++) {
			int bangou = sc.nextInt();
			shukudaiyaruhi += bangou;
		} int i=0 ; int i=0 ; i 0 i<kazu i kazu i++ i++ i {
			int bangou = sc.nextInt();
			shukudaiyaruhi += bangou;
		} {
			int bangou = sc.nextInt();
			shukudaiyaruhi += bangou;
		} int bangou = sc.nextInt(); bangou sc.nextInt() sc.nextInt sc shukudaiyaruhi += bangou shukudaiyaruhi bangou if(natsuyasumi-shukudaiyaruhi>=0) {
			System.out.print(natsuyasumi-shukudaiyaruhi);
		}
		else {
			System.out.print(-1);
		} natsuyasumi-shukudaiyaruhi>=0 natsuyasumi-shukudaiyaruhi natsuyasumi shukudaiyaruhi 0 {
			System.out.print(natsuyasumi-shukudaiyaruhi);
		} System.out.print(natsuyasumi-shukudaiyaruhi) System.out.print System.out System System.out natsuyasumi-shukudaiyaruhi natsuyasumi shukudaiyaruhi {
			System.out.print(-1);
		} System.out.print(-1) System.out.print System.out System System.out -1 1 String[] args args public class Main {
	public static void main(String[] args){

//	入力の読み込み
		Scanner sc = new Scanner(System.in);
		int natsuyasumi = sc.nextInt();
		int kazu = sc.nextInt();
		int shukudaiyaruhi = 0;

//	宿題の数分、宿題やる日を宿題番号分だけ増やす
		for(int i=0 ; i<kazu ; i++) {
			int bangou = sc.nextInt();
			shukudaiyaruhi += bangou;
		}

//	遊べる日数が0日以上かどうか判断
		if(natsuyasumi-shukudaiyaruhi>=0) {
			System.out.print(natsuyasumi-shukudaiyaruhi);
		}
		else {
			System.out.print(-1);
		}
	}
} public class Main {
	public static void main(String[] args){

//	入力の読み込み
		Scanner sc = new Scanner(System.in);
		int natsuyasumi = sc.nextInt();
		int kazu = sc.nextInt();
		int shukudaiyaruhi = 0;

//	宿題の数分、宿題やる日を宿題番号分だけ増やす
		for(int i=0 ; i<kazu ; i++) {
			int bangou = sc.nextInt();
			shukudaiyaruhi += bangou;
		}

//	遊べる日数が0日以上かどうか判断
		if(natsuyasumi-shukudaiyaruhi>=0) {
			System.out.print(natsuyasumi-shukudaiyaruhi);
		}
		else {
			System.out.print(-1);
		}
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args){

//	入力の読み込み
		Scanner sc = new Scanner(System.in);
		int natsuyasumi = sc.nextInt();
		int kazu = sc.nextInt();
		int shukudaiyaruhi = 0;

//	宿題の数分、宿題やる日を宿題番号分だけ増やす
		for(int i=0 ; i<kazu ; i++) {
			int bangou = sc.nextInt();
			shukudaiyaruhi += bangou;
		}

//	遊べる日数が0日以上かどうか判断
		if(natsuyasumi-shukudaiyaruhi>=0) {
			System.out.print(natsuyasumi-shukudaiyaruhi);
		}
		else {
			System.out.print(-1);
		}
	}
}