#include <stdio.h>
 
int main(){
  int days, num;
  //scanf("%d %d ", &days, &num);
  int left = days;
  int memo;
  for(int i=0; i<num; i++){
    //scanf("%d ", &memo);
    left -= memo;
    
  }
  if(left < 0){
    printf("-1\n");
  }else{
    printf("%d\n", left);
  
  return 0;
}