Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = input()
- b = input()
- x = []
- y = []
- count = [0] * (max(a) + 1)
- for elem in a:
- count[elem] += 1
- for i in range(len(count)):
- for j in range(count[i]):
- x += i, end = ' '
- count = [0] * (max(b) + 1)
- for elem in b:
- count[elem] += 1
- for i in range(len(count)):
- for j in range(count[i]):
- y += i, end = ' '
- if x == y:
- print('YES')
- else:
- print('NO')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement