Formidable


Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
C++, Java, Python

You wander into the casino's smoky back-room lounge and discover Formidable, a lightning-fast duel of high cards and sharper wits. Both players draw n cards. The dealer reveals all n of their cards face-up on the table. Then, you choose how to pair each of your n cards against the dealer's, one-for-one.

For every pair:

  • You score 1 point if your card's value is strictly greater than the dealer's.
  • The dealer scores 1 point if their card is at least as large as yours.

The side with more points wins. A tie goes to the house. Given both starting hands, can you beat the dealer?

Input

The first line consists of an integer n (1 \leq n \leq 10^5), the number of cards the dealer and you each have.

The second line consists of n integers d_1, ..., d_n (1 \leq d_i \leq 10^8), the values of the dealer's cards.

The third line consists of n integers p_1, ..., p_n (1 \leq p_i \leq 10^8), the values of your cards.

Output

If you can win the game, output "Yes". Otherwise, output "No".

Clarifications

  • If both players have the same number of points at the end of the game, it is a tie. In this case, you do not win the game.

Example

Input 1
5
1 5 2 4 3
2 5 4 4 1
Output 1
Yes

You can win the game, as you can match:

  • 2 vs 1 (win)
  • 4 vs 5 (loss)
  • 5 vs 2 (win)
  • 1 vs 4 (loss)
  • 4 vs 3 (win)

Note that this is not the only way she can win the game.

Input 2
3
200 200 200
300 100 100
Output 2
No

There is nothing you can do, the dealer will always win no matter how you match up your cards.


Comments

There are no comments at the moment.