#include <stdio.h>
int main(void)
{
          int days , a;
          int i ;
          scanf("%d%d", &days, &a ) ;
          int d, sum = 0;
          for ( i = 0 ; i < a ; i++)
          {
                   scanf("%d", &d) ;
                   sum += d ;
          }
          if(sum > days) printf("-1") ;
          else printf("%d", days - sum) ;
          return 0 ;
}
