#C9254. Ticket Distribution
Ticket Distribution
Ticket Distribution
Problem Description:
You are organizing an event with ( n ) attendees and ( m ) tickets. Each ticket must be assigned to a unique attendee and no attendee can receive more than one ticket. The goal is to determine if it is possible to distribute all ( m ) tickets fairly among ( n ) attendees.
The distribution is possible if and only if ( m \leq n ). In other words, if the number of tickets exceeds the number of attendees, then at least one attendee would get more than one ticket, making a fair distribution impossible.
Example:
For an event with 5 attendees and 5 tickets, the distribution is possible because ( 5 \leq 5 ) and the answer is "YES". Conversely, if there are 4 attendees and 5 tickets, since ( 5 > 4 ), the answer is "NO".
inputFormat
Input is provided via standard input (stdin) and consists of four lines:
1. The first line contains a single integer ( n ), representing the number of attendees.
2. The second line contains ( n ) space-separated integers representing the unique attendee IDs. (If ( n = 0 ), this line will be empty.)
3. The third line contains a single integer ( m ), representing the number of tickets.
4. The fourth line contains ( m ) space-separated integers representing the unique ticket IDs. (If ( m = 0 ), this line will be empty.)
outputFormat
Output a single line to standard output (stdout) containing "YES" if it is possible to distribute all tickets fairly (i.e. if ( m \leq n )); otherwise, output "NO".## sample
5
1 2 3 4 5
5
10 11 12 13 14
YES