import std.stdio, std.conv, std.string, std.algorithm,
       std.math, std.array, std.container, std.typecons;

void main() {
  long n, m;
  readf("%d %d\n", &n, &m);
  long[] a = readln.chomp.split.to!(long[]);
  long sum = 0;
  foreach(ai;a) sum += ai;
  sum = n - sum;
  writeln(sum >= 0 ? sum : -1);
}
