Skip to lesson

A medium problem for practising 5.4 Array & String Techniques. Solve it in your own IDE, check it against every test, and open a hint only when you are stuck. 0/1 solved.

1. Valid anagram usernames

medium

A college fest app does not allow a new username that is just the letters of an existing username in a different order, such as riya and aryi.

Given two usernames, print YES if the second one uses exactly the same letters as the first, each the same number of times. Otherwise print NO.

Input: The first line has the first username. The second line has the second username.

Output: One word: YES or NO.

Limits: 1 ≤ length of each username ≤ 10^5 · Usernames have only small letters a–z

Example 1

Input

riya
aryi

Output

YES

Both have one r, one i, one y and one a.

Example 2

Input

aab
abb

Output

NO

The first has two a, the second has two b.

Submit to solve