//keshavs first usaco solve :)
 
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
 
public class Main {
 
	public static void main(String[] args) throws FileNotFoundException {
		// TODO Auto-generated method stub
 
		Scanner sc = new Scanner(System.in);
		int total = sc.nextInt();
      	int as = sc.nextInt();
      	int sum = 0;
      	for(int i = 0 ; i<as; i++) 
        {
          sum+= sc.nextInt();
        }
      	if(total-sum >= 0){
         System.out.println(total-sum); 
          
        }
      	else{
         System.out.println(-1); 
        }
	}
 
} import java.io.File; File java.io import java.io.FileNotFoundException; FileNotFoundException java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
 
	public static void main(String[] args) throws FileNotFoundException {
		// TODO Auto-generated method stub
 
		Scanner sc = new Scanner(System.in);
		int total = sc.nextInt();
      	int as = sc.nextInt();
      	int sum = 0;
      	for(int i = 0 ; i<as; i++) 
        {
          sum+= sc.nextInt();
        }
      	if(total-sum >= 0){
         System.out.println(total-sum); 
          
        }
      	else{
         System.out.println(-1); 
        }
	}
 
} Main public static void main(String[] args) throws FileNotFoundException {
		// TODO Auto-generated method stub
 
		Scanner sc = new Scanner(System.in);
		int total = sc.nextInt();
      	int as = sc.nextInt();
      	int sum = 0;
      	for(int i = 0 ; i<as; i++) 
        {
          sum+= sc.nextInt();
        }
      	if(total-sum >= 0){
         System.out.println(total-sum); 
          
        }
      	else{
         System.out.println(-1); 
        }
	} main {
		// TODO Auto-generated method stub
 
		Scanner sc = new Scanner(System.in);
		int total = sc.nextInt();
      	int as = sc.nextInt();
      	int sum = 0;
      	for(int i = 0 ; i<as; i++) 
        {
          sum+= sc.nextInt();
        }
      	if(total-sum >= 0){
         System.out.println(total-sum); 
          
        }
      	else{
         System.out.println(-1); 
        }
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int total = sc.nextInt(); total sc.nextInt() sc.nextInt sc int as = sc.nextInt(); as sc.nextInt() sc.nextInt sc int sum = 0; sum 0 for(int i = 0 ; i<as; i++) 
        {
          sum+= sc.nextInt();
        } int i = 0 ; int i = 0 ; i 0 i<as i as i++ i++ i {
          sum+= sc.nextInt();
        } {
          sum+= sc.nextInt();
        } sum+= sc.nextInt() sum sc.nextInt() sc.nextInt sc if(total-sum >= 0){
         System.out.println(total-sum); 
          
        }
      	else{
         System.out.println(-1); 
        } total-sum >= 0 total-sum total sum 0 {
         System.out.println(total-sum); 
          
        } System.out.println(total-sum) System.out.println System.out System System.out total-sum total sum {
         System.out.println(-1); 
        } System.out.println(-1) System.out.println System.out System System.out -1 1 String[] args args public class Main {
 
	public static void main(String[] args) throws FileNotFoundException {
		// TODO Auto-generated method stub
 
		Scanner sc = new Scanner(System.in);
		int total = sc.nextInt();
      	int as = sc.nextInt();
      	int sum = 0;
      	for(int i = 0 ; i<as; i++) 
        {
          sum+= sc.nextInt();
        }
      	if(total-sum >= 0){
         System.out.println(total-sum); 
          
        }
      	else{
         System.out.println(-1); 
        }
	}
 
} public class Main {
 
	public static void main(String[] args) throws FileNotFoundException {
		// TODO Auto-generated method stub
 
		Scanner sc = new Scanner(System.in);
		int total = sc.nextInt();
      	int as = sc.nextInt();
      	int sum = 0;
      	for(int i = 0 ; i<as; i++) 
        {
          sum+= sc.nextInt();
        }
      	if(total-sum >= 0){
         System.out.println(total-sum); 
          
        }
      	else{
         System.out.println(-1); 
        }
	}
 
} Main
//keshavs first usaco solve :)
 
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
 
public class Main {
 
	public static void main(String[] args) throws FileNotFoundException {
		// TODO Auto-generated method stub
 
		Scanner sc = new Scanner(System.in);
		int total = sc.nextInt();
      	int as = sc.nextInt();
      	int sum = 0;
      	for(int i = 0 ; i<as; i++) 
        {
          sum+= sc.nextInt();
        }
      	if(total-sum >= 0){
         System.out.println(total-sum); 
          
        }
      	else{
         System.out.println(-1); 
        }
	}
 
}