import java.util.*;
 
public class Main { //クラス名はMain
    public static void main(String[] args) {
      //整数の入力
      List<String> list = new ArrayList<String>();
      Scanner sc = new Scanner(System.in);
      Integer ndate = Integer.parseInt(sc.next());
      Integer msyuku = Integer.parseInt(sc.next());
      
      //宿題の日数の記録
      List<Integer> num = new ArrayList<>();
      for (int i=0; i<msyuku; i++) {
          int di = sc.nextInt();
          num.add(di);
      }

      int asobu = 0;
      //日数を減らす
      for (int n : num){
          ndate -= n;
      }

      //宿題を終わらせられなければ-1
      if(ndate < 0){
          ndate = -1;
      }

      System.out.println(ndate);
    }
    
} import java.util.*; util.* java public class Main { //クラス名はMain
    public static void main(String[] args) {
      //整数の入力
      List<String> list = new ArrayList<String>();
      Scanner sc = new Scanner(System.in);
      Integer ndate = Integer.parseInt(sc.next());
      Integer msyuku = Integer.parseInt(sc.next());
      
      //宿題の日数の記録
      List<Integer> num = new ArrayList<>();
      for (int i=0; i<msyuku; i++) {
          int di = sc.nextInt();
          num.add(di);
      }

      int asobu = 0;
      //日数を減らす
      for (int n : num){
          ndate -= n;
      }

      //宿題を終わらせられなければ-1
      if(ndate < 0){
          ndate = -1;
      }

      System.out.println(ndate);
    }
    
} Main public static void main(String[] args) {
      //整数の入力
      List<String> list = new ArrayList<String>();
      Scanner sc = new Scanner(System.in);
      Integer ndate = Integer.parseInt(sc.next());
      Integer msyuku = Integer.parseInt(sc.next());
      
      //宿題の日数の記録
      List<Integer> num = new ArrayList<>();
      for (int i=0; i<msyuku; i++) {
          int di = sc.nextInt();
          num.add(di);
      }

      int asobu = 0;
      //日数を減らす
      for (int n : num){
          ndate -= n;
      }

      //宿題を終わらせられなければ-1
      if(ndate < 0){
          ndate = -1;
      }

      System.out.println(ndate);
    } main {
      //整数の入力
      List<String> list = new ArrayList<String>();
      Scanner sc = new Scanner(System.in);
      Integer ndate = Integer.parseInt(sc.next());
      Integer msyuku = Integer.parseInt(sc.next());
      
      //宿題の日数の記録
      List<Integer> num = new ArrayList<>();
      for (int i=0; i<msyuku; i++) {
          int di = sc.nextInt();
          num.add(di);
      }

      int asobu = 0;
      //日数を減らす
      for (int n : num){
          ndate -= n;
      }

      //宿題を終わらせられなければ-1
      if(ndate < 0){
          ndate = -1;
      }

      System.out.println(ndate);
    } List<String> list = new ArrayList<String>(); list new ArrayList<String>() Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Integer ndate = Integer.parseInt(sc.next()); ndate Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Integer msyuku = Integer.parseInt(sc.next()); msyuku Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc List<Integer> num = new ArrayList<>(); num new ArrayList<>() for (int i=0; i<msyuku; i++) {
          int di = sc.nextInt();
          num.add(di);
      } int i=0; int i=0; i 0 i<msyuku i msyuku i++ i++ i {
          int di = sc.nextInt();
          num.add(di);
      } {
          int di = sc.nextInt();
          num.add(di);
      } int di = sc.nextInt(); di sc.nextInt() sc.nextInt sc num.add(di) num.add num di int asobu = 0; asobu 0 for (int n : num){
          ndate -= n;
      } int n num {
          ndate -= n;
      } {
          ndate -= n;
      } ndate -= n ndate n if(ndate < 0){
          ndate = -1;
      } ndate < 0 ndate 0 {
          ndate = -1;
      } ndate = -1 ndate -1 1 System.out.println(ndate) System.out.println System.out System System.out ndate String[] args args public class Main { //クラス名はMain
    public static void main(String[] args) {
      //整数の入力
      List<String> list = new ArrayList<String>();
      Scanner sc = new Scanner(System.in);
      Integer ndate = Integer.parseInt(sc.next());
      Integer msyuku = Integer.parseInt(sc.next());
      
      //宿題の日数の記録
      List<Integer> num = new ArrayList<>();
      for (int i=0; i<msyuku; i++) {
          int di = sc.nextInt();
          num.add(di);
      }

      int asobu = 0;
      //日数を減らす
      for (int n : num){
          ndate -= n;
      }

      //宿題を終わらせられなければ-1
      if(ndate < 0){
          ndate = -1;
      }

      System.out.println(ndate);
    }
    
} public class Main { //クラス名はMain
    public static void main(String[] args) {
      //整数の入力
      List<String> list = new ArrayList<String>();
      Scanner sc = new Scanner(System.in);
      Integer ndate = Integer.parseInt(sc.next());
      Integer msyuku = Integer.parseInt(sc.next());
      
      //宿題の日数の記録
      List<Integer> num = new ArrayList<>();
      for (int i=0; i<msyuku; i++) {
          int di = sc.nextInt();
          num.add(di);
      }

      int asobu = 0;
      //日数を減らす
      for (int n : num){
          ndate -= n;
      }

      //宿題を終わらせられなければ-1
      if(ndate < 0){
          ndate = -1;
      }

      System.out.println(ndate);
    }
    
} Main
import java.util.*;
 
public class Main { //クラス名はMain
    public static void main(String[] args) {
      //整数の入力
      List<String> list = new ArrayList<String>();
      Scanner sc = new Scanner(System.in);
      Integer ndate = Integer.parseInt(sc.next());
      Integer msyuku = Integer.parseInt(sc.next());
      
      //宿題の日数の記録
      List<Integer> num = new ArrayList<>();
      for (int i=0; i<msyuku; i++) {
          int di = sc.nextInt();
          num.add(di);
      }

      int asobu = 0;
      //日数を減らす
      for (int n : num){
          ndate -= n;
      }

      //宿題を終わらせられなければ-1
      if(ndate < 0){
          ndate = -1;
      }

      System.out.println(ndate);
    }
    
}
