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

int main()
{
   int days,assign,i,day,t=0;
   scanf("%d %d",&days,&assign);
   for(i=0;i<assign;i++)
   {
       scanf("%d",&day);
       t+=day;
   }
   if(days>=t)
   {
       printf("%d",days-t);
   }
   else printf("-1");
    return 0;
}