#include <stdio.h>

int main()
{
    int i, days, assignments, total_work=0;
    int workdays, hangout_days;

    scanf("%d %d", &days, &assignments);

    for(i = 1;i<=assignments;i++)
    {
        printf("Enter the %d th assigments finish days:", i);
        scanf("%d", &workdays);
        total_work +=workdays;
    }

    hangout_days = days-total_work;

    if(days<workdays)
    {
        printf("%d", hangout_days);
        printf("He cannot finish his assignments.");


    }
    else if(days=workdays)
    {

         printf("%d", hangout_days);
        printf("He can finish his assignments, but he will have no time to hang out.");

    }

    else
    {
         printf("Hangout_days :%d", hangout_days);
    }




    return 0;
}