import std.algorithm;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main() {
  int n, m;
  readf (" %d %d", n, m);
  auto a = new int[m];
  foreach (t; 0 .. m) {
    readf (" %d", a[t]);
  }
  auto r = n - sum (a);
  writeln (max (-1, r));
}

