#abc345a. A - Leftrightarrow

A - Leftrightarrow

Scoring: 100100 points

问题陈述

给定一个由 <=> 组成的字符串 SS。 判断 SS 是否是一个 双向箭头 字符串。 一个字符串 SS 是双向箭头字符串当且仅当存在一个正整数 kk,使得 SS 是按照这个顺序连接一个 <kk= 和一个 >,长度为 (k+2)(k+2)

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

Problem Statement

You are given a string SS consisting of <, =, and >.
Determine whether SS is a bidirectional arrow string.
A string SS is a bidirectional arrow string if and only if there is a positive integer kk such that SS is a concatenation of one <, kk =s, and one >, in this order, with a length of (k+2)(k+2).

Constraints

  • SS is a string of length between 33 and 100100, inclusive, consisting of <, =, and >.

Input

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

SS

Output

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

Sample Input 1

<====>

Sample Output 1

Yes

<====> is a concatenation of one <, four =s, and one >, in this order, so it is a bidirectional arrow string.
Hence, print Yes.

Sample Input 2

\==>

Sample Output 2

No

==> does not meet the condition for a bidirectional arrow string.
Hence, print No.

Sample Input 3

<>>

Sample Output 3

No

update @ 2024/5/16 17:16:35