#include <stdio.h>

int CountFreeDays()
{
	int vacationDays, assignments, daysRequired = 0;

	while (1)
	{
		//printf("Enter the vacation days and assigments...\n");
		scanf("%d %d", &vacationDays, &assignments);
		if (vacationDays < 1000000 && vacationDays > 0 && assignments < 1000 && assignments > 0)
		{
			for (int i = 0; i < assignments; i++)
			{
				int oneAssignment;
				scanf("%d", &oneAssignment);
				if (oneAssignment < 1000 && oneAssignment > 1)
				{
					daysRequired += oneAssignment;
				}
				else
				{
					printf_s("Wrong Input \n");
					return -1;
				}
			}
			break;
		}
		else
		{
			printf_s("Wrong input \n");
		}
	}
	return vacationDays - daysRequired;
}

int main(int argc, const char* argv[])
{

	int freeDays = CountFreeDays();

	if (freeDays < 0)
	{
		printf_s("-1 \n");
	}
	else
	{
		printf_s("You will have %d free days \n", freeDays);
	}

	return 0;
}