import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long n=sc.nextInt(),m=sc.nextInt();
    long sum=0;
    for(long i=0;i<m;i++)sum+=sc.nextLong();
    System.out.println(Math.max(n-sum, -1));
    
  }
} import java.util.Scanner; Scanner java.util public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long n=sc.nextInt(),m=sc.nextInt();
    long sum=0;
    for(long i=0;i<m;i++)sum+=sc.nextLong();
    System.out.println(Math.max(n-sum, -1));
    
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long n=sc.nextInt(),m=sc.nextInt();
    long sum=0;
    for(long i=0;i<m;i++)sum+=sc.nextLong();
    System.out.println(Math.max(n-sum, -1));
    
  } main {
    Scanner sc = new Scanner(System.in);
    long n=sc.nextInt(),m=sc.nextInt();
    long sum=0;
    for(long i=0;i<m;i++)sum+=sc.nextLong();
    System.out.println(Math.max(n-sum, -1));
    
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n=sc.nextInt() n sc.nextInt() sc.nextInt sc m=sc.nextInt(); m sc.nextInt() sc.nextInt sc long sum=0; sum 0 for(long i=0;i<m;i++)sum+=sc.nextLong(); long i=0; long i=0; i 0 i<m i m i++ i++ i sum+=sc.nextLong(); sum+=sc.nextLong() sum sc.nextLong() sc.nextLong sc System.out.println(Math.max(n-sum, -1)) System.out.println System.out System System.out Math.max(n-sum, -1) Math.max Math n-sum n sum -1 1 String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long n=sc.nextInt(),m=sc.nextInt();
    long sum=0;
    for(long i=0;i<m;i++)sum+=sc.nextLong();
    System.out.println(Math.max(n-sum, -1));
    
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long n=sc.nextInt(),m=sc.nextInt();
    long sum=0;
    for(long i=0;i<m;i++)sum+=sc.nextLong();
    System.out.println(Math.max(n-sum, -1));
    
  }
} Main
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long n=sc.nextInt(),m=sc.nextInt();
    long sum=0;
    for(long i=0;i<m;i++)sum+=sc.nextLong();
    System.out.println(Math.max(n-sum, -1));
    
  }
}
