A legacy device protocol encodes each message as a sequence of n integer symbol codes. A migration tool needs to check whether an old message and a new message could have come from the same original data under some one-to-one relabeling of symbol codes — that is, whether there exists a bijection f such that applying f to every code in the old sequence produces the new sequence exactly (equal codes in the old sequence must map to equal codes in the new sequence, and different codes in the old sequence must map to different codes in the new sequence).
Print YES if such a bijection exists, otherwise print NO.
Input format
Line 1: an integer n — the length of both sequences.
Line 2: n space-separated integers — the old sequence.
Line 3: n space-separated integers — the new sequence.
Output format
YES if a valid one-to-one relabeling exists, otherwise NO.
Constraints
- 1 ≤ n ≤ 100000
- 0 ≤ each code ≤ 1000000000