#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main(){
  int N,M;
  int *A;
  char line[128];
  char line2[] = " ";

  fgets(line,sizeof(line),stdin);
  sscanf(line,"%d%d",&N,&M);

  A = (int *)malloc(M * sizeof(int));

  fgets(line,sizeof(line),stdin);

  int i;
  char *temp;
  int homework_day = 0;
  temp = strtok(line,line2);
  for(i=0;i<M;i++){
    A[i] = atoi(temp);
    temp = strtok(NULL,line2);
    homework_day += A[i];
    printf("%s",line);
  }

  for(i=0;i<M;i++){
    printf("%d",A[i]);
    printf("\n");
  }
  printf("\n");

  int play_day = N - homework_day;

  if(play_day <= -1){
    printf("-1");
  }else{
    printf("%d",play_day);
  }

  free(A);
  return 0;
}
