#abc352a. A - AtCoder Line

A - AtCoder Line

Score: 100100 points

问题陈述

AtCoder 铁路线有 NN 个车站,编号为 1,2,,N1, 2, \ldots, N

在这条线路上,有 进站列车 从车站 11 开始,按顺序停在车站 2,3,,N2, 3, \ldots, N,还有 出站列车 从车站 NN 开始,按顺序停在车站 N1,N2,,1N - 1, N - 2, \ldots, 1

高桥即将使用其中一列进站或出站列车,从车站 XX 旅行到车站 YY

确定在这次旅行中,列车是否会在车站 ZZ 停靠。

以上为大语言模型 kimi 翻译,仅供参考。

Problem Statement

The AtCoder railway line has NN stations, numbered 1,2,,N1, 2, \ldots, N.

On this line, there are inbound trains that start at station 11 and stop at the stations 2,3,,N2, 3, \ldots, N in order, and outbound trains that start at station NN and stop at the stations N1,N2,,1N - 1, N - 2, \ldots, 1 in order.

Takahashi is about to travel from station XX to station YY using only one of the inbound and outbound trains.

Determine whether the train stops at station ZZ during this travel.

Constraints

  • 3N1003 \leq N \leq 100
  • 1X,Y,ZN1 \leq X, Y, Z \leq N
  • XX, YY, and ZZ are distinct.
  • All input values are integers.

Input

The input is given from Standard Input in the following format:

NN XX YY ZZ

Output

If the train stops at station ZZ during the travel from station XX to station YY, print Yes; otherwise, print No.

Sample Input 1

7 6 1 3

Sample Output 1

Yes

To travel from station 66 to station 11, Takahashi will take an outbound train.

After departing from station 66, the train stops at stations 5,4,3,2,15, 4, 3, 2, 1 in order, which include station 33, so you should print Yes.

Sample Input 2

10 3 2 9

Sample Output 2

No

Sample Input 3

100 23 67 45

Sample Output 3

Yes