#include<stdio.h>                                                 
                                                                  
int main(void){                                                   
   int N,M;                                                       
   scanf("%d %d",&N,&M);                                          
   int day[M];                                                    
                                                                  
   for(int i = 0; i < M; i++){                                    
      scanf("%d ",&day[i]);                                       
      N -= day[i];                                                
   }                                                              
   if(N < 0){                                                     
      printf("-1");                                               
   }else{                                                         
      printf("%d",N);                                             
   }                                                              
}       