Codeforces Round 471 (Div. 2)
B
Not simply beatiful strings
Codeforces
1400
原题
← AC →
翻译中…

Let's call a string adorable if its letters can be realigned in such a way that they form two consequent groups of equal symbols (note that different groups must contain different symbols). For example, ababa is adorable (you can transform it to aaabb, where the first three letters form a group of $*a*$-s and others — a group of $*b*$-s), but cccc is not since in each possible consequent partition letters in these two groups coincide.

翻译中…

You're given a string $*s*$. Check whether it can be split into two non-empty subsequences such that the strings formed by these subsequences are adorable. Here a subsequence is an arbitrary set of indexes of the string.

翻译中…

Input

翻译中…

The only line contains $*s*$ $(1 ≤ |*s*| ≤ 10^{5})$ consisting of lowercase latin letters.

翻译中…

Output

翻译中…

Print «Yes» if the string can be split according to the criteria above or «No» otherwise.

翻译中…

Each letter can be printed in arbitrary case.

翻译中…

Note

翻译中…

In sample case two zzcxx can be split into subsequences zc and zxx each of which is adorable.

翻译中…

There's no suitable partition in sample case three.

翻译中…

样例

Input #1
ababa
Output #1
Yes
InputCopy OutputCopy
Input #2
zzcxx
Output #2
Yes
InputCopy OutputCopy
Input #3
yeee
Output #3
No
InputCopy OutputCopy
题目信息
题号
955B
时间限制
1 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。