'use strict';
const main = arg => {
  const input = arg.trim().split('\n');
  const input1 = input[0].split(' ').map(n => parseInt(n, 10));
  const input2 = input[1].split(' ').map(n => parseInt(n, 10));

  const days = input1[0];
  const works = input1[1];

  const add = (a, b) => {
    return a + b
  };

  const daysToFinish = input2.reduce((a, x) => add(a, x));
  const answer = days - daysToFinish >= 0
    ? days - daysToFinish
    : -1 ;

  console.log(answer);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));