const Main = (input) => {
  const holidays = parseInt(input.split('\n')[0].trim().split(' ')[0])
  const tasks = input
    .split('\n')[1]
    .trim()
    .split(' ')
    .map((n) => parseInt(n))

  let sum = 0
  tasks.forEach((element) => {
    sum += element
  })

  let result
  result = holidays - sum

  if (result < 0) {
    result = -1
  }

  console.log(result)
  return result
}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'))
