103260: [Atcoder]ABC326 A - 2UP3DOWN

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:14 Solved:0

Description

Score : $100$ points

Problem Statement

Takahashi is in a building with $100$ floors.

He uses the stairs for moving up two floors or less or moving down three floors or less, and uses the elevator otherwise.

Does he use the stairs to move from floor $X$ to floor $Y$?

Constraints

  • $1 \leq X,Y \leq 100$
  • $X \neq Y$
  • All input values are integers.

Input

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

$X$ $Y$

Output

If Takahashi uses the stairs for the move, print Yes; if he uses the elevator, print No.


Sample Input 1

1 4

Sample Output 1

No

The move from floor $1$ to floor $4$ involves going up three floors, so Takahashi uses the elevator.


Sample Input 2

99 96

Sample Output 2

Yes

The move from floor $99$ to floor $96$ involves going down three floors, so Takahashi uses the stairs.


Sample Input 3

100 1

Sample Output 3

No

Output

得分:100分

问题描述

高桥在一栋有100层的大楼里。

他使用楼梯移动两层或更少的楼层,或者向下移动三层或更少的楼层,否则使用电梯。

他从$X$层移动到$Y$层时会使用楼梯吗?

约束条件

  • $1 \leq X,Y \leq 100$
  • $X \neq Y$
  • 所有的输入值都是整数。

输入

输入数据以标准输入的以下格式给出:

$X$ $Y$

输出

如果高桥使用楼梯进行移动,则打印Yes;如果他使用电梯,则打印No


样例输入1

1 4

样例输出1

No

从$1$层移动到$4$层涉及向上移动三层,所以高桥使用电梯。


样例输入2

99 96

样例输出2

Yes

从$99$层移动到$96$层涉及向下移动三层,所以高桥使用楼梯。


样例输入3

100 1

样例输出3

No

HINT

你可以往上走不超过2层楼,往下走不超过3层楼,是否能从x楼到y楼?

加入题单

算法标签: