import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n;
		int m = 0;
		long ans = 0;
		long sum = 0;

		n = sc.nextLong();
		m = sc.nextInt();

		for (int i = 0; i < m; i++) 
			sum += sc.nextInt();
		

		if (n - sum >= 0)
			ans = n - sum;
		else
			ans = -1;
		System.out.print(ans);
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n;
		int m = 0;
		long ans = 0;
		long sum = 0;

		n = sc.nextLong();
		m = sc.nextInt();

		for (int i = 0; i < m; i++) 
			sum += sc.nextInt();
		

		if (n - sum >= 0)
			ans = n - sum;
		else
			ans = -1;
		System.out.print(ans);
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n;
		int m = 0;
		long ans = 0;
		long sum = 0;

		n = sc.nextLong();
		m = sc.nextInt();

		for (int i = 0; i < m; i++) 
			sum += sc.nextInt();
		

		if (n - sum >= 0)
			ans = n - sum;
		else
			ans = -1;
		System.out.print(ans);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		long n;
		int m = 0;
		long ans = 0;
		long sum = 0;

		n = sc.nextLong();
		m = sc.nextInt();

		for (int i = 0; i < m; i++) 
			sum += sc.nextInt();
		

		if (n - sum >= 0)
			ans = n - sum;
		else
			ans = -1;
		System.out.print(ans);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n; n int m = 0; m 0 long ans = 0; ans 0 long sum = 0; sum 0 n = sc.nextLong() n sc.nextLong() sc.nextLong sc m = sc.nextInt() m sc.nextInt() sc.nextInt sc for (int i = 0; i < m; i++) 
			sum += sc.nextInt(); int i = 0; int i = 0; i 0 i < m i m i++ i++ i sum += sc.nextInt(); sum += sc.nextInt() sum sc.nextInt() sc.nextInt sc if (n - sum >= 0)
			ans = n - sum;
		else
			ans = -1; n - sum >= 0 n - sum n sum 0 ans = n - sum ans n - sum n sum ans = -1 ans -1 1 System.out.print(ans) System.out.print System.out System System.out ans sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n;
		int m = 0;
		long ans = 0;
		long sum = 0;

		n = sc.nextLong();
		m = sc.nextInt();

		for (int i = 0; i < m; i++) 
			sum += sc.nextInt();
		

		if (n - sum >= 0)
			ans = n - sum;
		else
			ans = -1;
		System.out.print(ans);
		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n;
		int m = 0;
		long ans = 0;
		long sum = 0;

		n = sc.nextLong();
		m = sc.nextInt();

		for (int i = 0; i < m; i++) 
			sum += sc.nextInt();
		

		if (n - sum >= 0)
			ans = n - sum;
		else
			ans = -1;
		System.out.print(ans);
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n;
		int m = 0;
		long ans = 0;
		long sum = 0;

		n = sc.nextLong();
		m = sc.nextInt();

		for (int i = 0; i < m; i++) 
			sum += sc.nextInt();
		

		if (n - sum >= 0)
			ans = n - sum;
		else
			ans = -1;
		System.out.print(ans);
		sc.close();
	}
}