P11926 [AOJ] Mapping
普及
题目描述

problem

AOR Ika made a set $S = \\ {a_1, ..., a_N \\}$ and a map $ f: S → S $. $ f (a_i) = b_i $. For any element $ x $ in the set $ S $, all maps $ g, h: S → S $ satisfying $ g (f (x)) = h (f (x)) $ are $ g (x). ) = Determine if h (x) $ is satisfied, and if not, configure one counterexample.

Example

Input

5
1 2 3 4 5
3 4 2 5 1

Output

Yes

输入格式

见题面

输出格式

见题面

样例输入
5 1 2 3 4 5 3 4 2 5 1
样例输出
Yes