#D6824. Mapping

    ID: 5675 Type: Default 1000ms 268MiB

Mapping

Mapping

problem

AOR Ika made a set S=a1,...,aN S = \\ {a_1, ..., a_N \\} and a map f:SS f: S → S . f(ai)=bi f (a_i) = b_i . For any element x x in the set S S , all maps g,h:SS g, h: S → S satisfying g(f(x))=h(f(x)) g (f (x)) = h (f (x)) are g(x).)=Determineifh(x) 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

inputFormat

Input

5 1 2 3 4 5 3 4 2 5 1

outputFormat

Output

Yes

样例

5
1 2 3 4 5
3 4 2 5 1
Yes