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 \le a \le b \le 1000$ - $1 \le c \le d \le 1000$ ### Sample test ``` 1 2 2 3 ``` Output: ``` YES ```