import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] head = br.readLine().split(" ");
    int n = Integer.parseInt(head[0]);
    int m = Integer.parseInt(head[1]);
    int sum = 0;
    String[] line = br.readLine().split(" ");
    for (int i = 0; i < m; i++) {
      sum += Integer.parseInt(line[i]);
    }
    System.out.println(Math.max(n - sum, -1));
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] head = br.readLine().split(" ");
    int n = Integer.parseInt(head[0]);
    int m = Integer.parseInt(head[1]);
    int sum = 0;
    String[] line = br.readLine().split(" ");
    for (int i = 0; i < m; i++) {
      sum += Integer.parseInt(line[i]);
    }
    System.out.println(Math.max(n - sum, -1));
  }
} Main public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] head = br.readLine().split(" ");
    int n = Integer.parseInt(head[0]);
    int m = Integer.parseInt(head[1]);
    int sum = 0;
    String[] line = br.readLine().split(" ");
    for (int i = 0; i < m; i++) {
      sum += Integer.parseInt(line[i]);
    }
    System.out.println(Math.max(n - sum, -1));
  } main {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] head = br.readLine().split(" ");
    int n = Integer.parseInt(head[0]);
    int m = Integer.parseInt(head[1]);
    int sum = 0;
    String[] line = br.readLine().split(" ");
    for (int i = 0; i < m; i++) {
      sum += Integer.parseInt(line[i]);
    }
    System.out.println(Math.max(n - sum, -1));
  } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] head = br.readLine().split(" "); head br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int n = Integer.parseInt(head[0]); n Integer.parseInt(head[0]) Integer.parseInt Integer head[0] head 0 int m = Integer.parseInt(head[1]); m Integer.parseInt(head[1]) Integer.parseInt Integer head[1] head 1 int sum = 0; sum 0 String[] line = br.readLine().split(" "); line br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for (int i = 0; i < m; i++) {
      sum += Integer.parseInt(line[i]);
    } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
      sum += Integer.parseInt(line[i]);
    } {
      sum += Integer.parseInt(line[i]);
    } sum += Integer.parseInt(line[i]) sum Integer.parseInt(line[i]) Integer.parseInt Integer line[i] line i 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) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] head = br.readLine().split(" ");
    int n = Integer.parseInt(head[0]);
    int m = Integer.parseInt(head[1]);
    int sum = 0;
    String[] line = br.readLine().split(" ");
    for (int i = 0; i < m; i++) {
      sum += Integer.parseInt(line[i]);
    }
    System.out.println(Math.max(n - sum, -1));
  }
} public class Main {

  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] head = br.readLine().split(" ");
    int n = Integer.parseInt(head[0]);
    int m = Integer.parseInt(head[1]);
    int sum = 0;
    String[] line = br.readLine().split(" ");
    for (int i = 0; i < m; i++) {
      sum += Integer.parseInt(line[i]);
    }
    System.out.println(Math.max(n - sum, -1));
  }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) throws Exception {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String[] head = br.readLine().split(" ");
    int n = Integer.parseInt(head[0]);
    int m = Integer.parseInt(head[1]);
    int sum = 0;
    String[] line = br.readLine().split(" ");
    for (int i = 0; i < m; i++) {
      sum += Integer.parseInt(line[i]);
    }
    System.out.println(Math.max(n - sum, -1));
  }
}
