#abc327a. A - ab

A - ab

Score : 100100 points

问题描述

给定一个长度为 NN 的由小写英文字母组成的字符串 SS

如果在 SS 中存在相邻的 ab,则输出 Yes;否则,输出 No。(ab 的顺序无关紧要。)

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

You are given a string SS of length NN consisting of lowercase English letters. If there are any adjacent occurrences of a and b in SS, print Yes; otherwise, print No. (The order of a and b does not matter.)

Constraints

  • 2N1002 \leq N \leq 100
  • SS is a string of length NN consisting of lowercase English letters.

Input

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

NN

SS

Output

If there are any adjacent occurrences of a and b in SS, print Yes; otherwise, print No.

Sample Input 1

3
abc

Sample Output 1

Yes

The string abc has a as the first character and b as the second character, which are adjacent. Thus, print Yes.

Sample Input 2

2
ba

Sample Output 2

Yes

The string ba has a as the second character and b as the first character, which are adjacent. (Note that the order of a and b does not matter.)

Sample Input 3

7
atcoder

Sample Output 3

No

update @ 2024/3/10 01:50:29