P24198 [AtCoder] typo
入门
题目描述

Problem Statement

You are given two strings S and T. Determine whether it is possible to make S and T equal by doing the following operation at most once:

  • choose two adjacent characters in S and swap them.

Note that it is allowed to choose not to do the operation.

Input

Input is given from Standard Input in the following format:
S
T

Output

If it is possible to make S and T equal by doing the operation in Problem Statement at most once, print Yes; otherwise, print No.

Constraints

  • Each of S and T is a string of length between 2 and 100 (inclusive) consisting of lowercase English letters.
  • S and T have the same length.

Sample Input 1

abc
acb

Sample Output 1

Yes

You can swap the 2-nd and 3-rd characters of S to make S and T equal.

Sample Input 2

aabb
bbaa

Sample Output 2

No

There is no way to do the operation to make S and T equal.

Sample Input 3

abcde
abcde

Sample Output 3

Yes

S and T are already equal.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
abc acb
样例输出
Yes