#abc381b. B - 1122 String

B - 1122 String

当前没有测试数据。

Score : 150150 points

问题陈述

如果一个字符串 TT 满足以下三个条件,则称其为 1122字符串

  • T\lvert T \rvert 是偶数。这里,T\lvert T \rvert 表示 TT 的长度。
  • 对于每个整数 ii,满足 1iT21\leq i\leq \frac{|T|}{2}TT 中的第 (2i1)(2i-1) 个和第 2i2i 个字符是相同的。
  • TT 中的每个字符恰好出现零次或两次。也就是说,TT 中包含的每个字符在 TT 中恰好出现两次。

给定一个由小写英文字母组成的字符串 SS,请打印 Yes 如果 SS 是一个 1122 字符串,否则打印 No

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

Problem Statement

A string TT is called a 1122 string if and only if it satisfies all of the following three conditions:

  • T\lvert T \rvert is even. Here, T\lvert T \rvert denotes the length of TT.
  • For each integer ii satisfying 1iT21\leq i\leq \frac{|T|}{2}, the (2i1)(2i-1)-th and 2i2i-th characters of TT are equal.
  • Each character appears in TT exactly zero or two times. That is, every character contained in TT appears exactly twice in TT.

Given a string SS consisting of lowercase English letters, print Yes if SS is a 1122 string, and No otherwise.

Constraints

  • SS is a string of length between 11 and 100100, inclusive, consisting of lowercase English letters.

Input

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

SS

Output

If SS is a 1122 string, print Yes; otherwise, print No.

Sample Input 1

aabbcc

Sample Output 1

Yes

S=S=aabbcc satisfies all the conditions for a 1122 string, so print Yes.

Sample Input 2

aab

Sample Output 2

No

S=S=aab has an odd length and does not satisfy the first condition, so print No.

Sample Input 3

zzzzzz

Sample Output 3

No

S=S=zzzzzz contains six zs and does not satisfy the third condition, so print No.