AT_past19_c 良さそうな数

Description

A **good number** is defined as follows. - A positive integer $ x $ is said to be a **good number** if and only if: - every pair of adjacent digits in $ x $ has a difference of $ 1 $ or less. - Formally, if $ x $ has $ k $ digits and its decimal representation is $ d_1d_2 \dots d_k $ , then $ |d_i - d_{i+1}| \le 1 $ for all integers $ i $ with $ 1 \le i < k $ . For example, $ 1,56,777 $ , and $ 3234 $ are good numbers, but $ 13,1235 $ , and $ 909 $ are not. A **goodish number** is defined as follows. - A positive integer $ x $ is said to be a **goodish number** if and only if: - one can modify at most one digit of $ x $ to make it a good number. Here, it is disallowed to produce a leading zero. - Formally, if $ x $ has $ k $ digit and its decimal representation is $ d_1d_2 \dots d_k $ , there exists an integer pair $ (p,q) $ such that: - $ 1 \le p \le k $ , - $ 0 \le q \le 9 $ , - $ (p,q) \neq (1,0) $ , and - setting $ d_p $ in $ x $ to $ q $ makes $ x $ a good number. - Note that a good number is always a goodish number. For example, given $ 7176 $ , one can set $ d_2 $ to $ 8 $ to make it $ 7876 $ , which is a good number, so $ 7176 $ is a goodish number. Given an integer $ N $ , determine if $ N $ is a goodish number.

Input Format

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

Output Format

Print `Yes` if $ N $ is a goodish number, and `No` otherwise.

Explanation/Hint

### Sample Explanation 1 This is the same as the example in the problem statement. ### Sample Explanation 2 $ 2020 $ is not a goodish number. ### Sample Explanation 4 $ N $ may not fit into a $ 32 $ -bit signed integer. Also, $ N $ itself may be a good number. ### Constraints - $ N $ is an integer such that $ 1 \le N < 10^{18} $ .