Processing math: 100%
Segment - MarisaOJ: Marisa Online Judge

Segment

Time limit: 1000 ms
Memory limit: 256 MB
Given two line segments, AB and CD, lying on the number line. Line segment AB extends from point a to point b, and line segment CD extends from point c to point d. Check if the two line segments have a common point. ### Input - A single line containing four integers a,b,c,d. ### Output - If the two line segments have a common point, print YES. Otherwise, print NO. ### Constraints - 1≤a≤b≤1000 - 1≤c≤d≤1000 ### Sample test 1223 Output: YES