103800: [Atcoder]ABC380 A - 123233

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

Description

Score : $100$ points

Problem Statement

You are given a $6$-digit positive integer $N$.
Determine whether $N$ satisfies all of the following conditions.

  • Among the digits of $N$, the digit $1$ appears exactly once.
  • Among the digits of $N$, the digit $2$ appears exactly twice.
  • Among the digits of $N$, the digit $3$ appears exactly three times.

Constraints

  • $N$ is an integer satisfying $100000 \le N \le 999999$.

Input

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

$N$

Output

Print Yes if $N$ satisfies all the conditions described in the problem statement, and No otherwise, in one line.


Sample Input 1

123233

Sample Output 1

Yes

$123233$ satisfies the conditions in the problem statement, so print Yes.


Sample Input 2

123234

Sample Output 2

No

$123234$ does not satisfy the conditions in the problem statement, so print No.


Sample Input 3

323132

Sample Output 3

Yes

Sample Input 4

500000

Sample Output 4

No

Output

得分:100分

问题陈述

给你一个6位正整数N。
判断N是否满足以下所有条件。

  • 在N的数字中,数字1恰好出现一次。
  • 在N的数字中,数字2恰好出现两次。
  • 在N的数字中,数字3恰好出现三次。

约束条件

  • N是一个整数,满足100000 ≤ N ≤ 999999。

输入

输入从标准输入以下格式给出:

N

输出

如果N满足问题陈述中描述的所有条件,则打印Yes,否则打印No,在一行内。


示例输入1

123233

示例输出1

Yes

123233满足问题陈述中的条件,所以打印Yes


示例输入2

123234

示例输出2

No

123234不满足问题陈述中的条件,所以打印No


示例输入3

323132

示例输出3

Yes

示例输入4

500000

示例输出4

No

加入题单

上一题 下一题 算法标签: