#K58537. Interval Overlap Checker

    ID: 30664 Type: Default 1000ms 256MiB

Interval Overlap Checker

Interval Overlap Checker

Given a set of intervals and a target interval, determine whether there exists an interval that overlaps with the target. Two intervals ( [a, b] ) and ( [c, d] ) are considered to overlap if and only if ( a \leq d ) and ( c \leq b ). This problem tests your ability to perform interval comparisons and handle standard input/output operations.

inputFormat

The first line contains an integer ( n ), the number of intervals. Each of the next ( n ) lines contains two space-separated integers representing an interval's start and end. The last line contains two space-separated integers representing the target interval.

outputFormat

Print "Yes" if at least one interval overlaps with the target interval, otherwise print "No".## sample

5
1 5
10 14
3 7
9 11
12 16
8 13
Yes