Similar Arrays - MarisaOJ: Marisa Online Judge

Similar Arrays

Time limit: 1000 ms
Memory limit: 256 MB
You are given two integer arrays $A$ and $B$ both of length $n$. Determine whether or not $A$ and $B$ are similar (i.e. every value appear the same number of times in both arrays). ### Input - The first line contains an integers $n$. - The second line contains $n$ integers $A_i$. - The third line contains $n$ integers $B_i$. ### Output - `YES` if $A$ and $B$ are similar, `NO` otherwise. ### Constraints - $1 \le n \le 1000$. - $|A_i|, |B_i| \le 1000$. ### Example Input: ``` 5 3 4 5 5 1 1 5 5 4 3 ``` Output: ``` YES ```