#K53687. Validate Session Time Slots

    ID: 29587 Type: Default 1000ms 256MiB

Validate Session Time Slots

Validate Session Time Slots

In this problem, you are given a series of time slots representing session intervals in the format (HH:MM-HH:MM). The task is to determine if any of the sessions overlap. Two sessions overlap if the start time of a session is earlier than the end time of a previous session when the sessions are sorted by start time. You need to output (YES) if there is no overlap and (NO) if there is at least one overlapping interval.

inputFormat

The input is read from standard input (stdin). The first line contains an integer (n) representing the number of sessions. The following (n) lines each contain a session in the format (HH:MM-HH:MM).

outputFormat

Output a single line to standard output (stdout) containing either (YES) if no sessions overlap, or (NO) if there is an overlapping session.## sample

3
09:00-10:00
10:00-11:00
11:00-12:00
YES