We’re preparing your current view and syncing the latest data.
Vasya and his opponent each have n wrestlers. Vasya wants to pair his wrestlers against his opponent's wrestlers in such a way that for every pair, the wrestler of Vasya is strictly heavier (has greater weight) than the opponent's wrestler. Given the weights of Vasya's wrestlers and the opponent's wrestlers, determine if such a pairing is possible.
The first line contains a single integer n (1 ≤ n ≤ 1000) — the number of wrestlers in each team. The second line contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^9) — the weights of Vasya's wrestlers. The third line contains n integers b_1, b_2, ..., b_n (1 ≤ b_i ≤ 10^9) — the weights of opponent's wrestlers.
Print "YES" (without quotes) if Vasya can assign his wrestlers to the opponent's wrestlers so that each Vasya's wrestler is strictly heavier than the matched opponent's wrestler. Otherwise, print "NO".
1 ≤ n ≤ 1000 1 ≤ a_i, b_i ≤ 10^9
Example 1
Input
3 1 2 3 2 3 4
Output
NO
Explanation
After sorting, Vasya's wrestlers are [1,2,3], opponent's wrestlers [2,3,4]. For the first wrestler pair (1 vs 2), Vasya's wrestler is not heavier, so answer is NO.
Example 2
Input
3 4 5 6 1 2 3
Output
YES
Explanation
After sorting: Vasya's wrestlers [4,5,6], Opponent's wrestlers [1,2,3]. Each Vasya wrestler is heavier than corresponding opponent wrestler, so answer is YES.