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