4899. String

单点时限: 1.0 sec

内存限制: 256 MB

Given two strings $s$ and $t$, it is possible to swap two adjacent characters in the same string at a time.

Please tell us if it is possible to make $s$ and $t$ the same after several swaps.

If yes, output “YES”, otherwise output “NO”.

输入格式

Two strings in two lines represent $s$ and $t$ respectively.

输出格式

A line of “YES” or “NO”.

样例

Input
ab
ba
Output
YES

提示

$1 \le |s|, |t| \le 1000$.

330 人解决,365 人已尝试。

352 份提交通过,共有 816 份提交。

1.7 EMB 奖励。

创建: 3 月,2 周前.

修改: 3 月,2 周前.

最后提交: 1 周,3 天前.

来源: N/A

题目标签