Under construction

Still being built. Things may change

Deja vu of Go Players

Interview

Time limit1sMemory limit256 MB

Summary
Red moves first and each player can empty one of their own piles per turn; decide whether red can always force a win.
Level

Easy3 of 10

Topics
Game theory, Implementation
Solved
No attempts yet

Problem

An ordinary sequence rather than magic codes? Rikka's opinion is much more important than the 'truth' itself. She soon felt sleepy and fell asleep to take a trip to dreamlands in passing.

Rikka found two elders playing Go when her sanity came back. The ethereal clouds, hardy vigorous pines, and rugged rocks shocked her. A fiction isekai! Excited, Rikka's eyes ran around and finally focused on the Go board.

The two players, wearing white and red respectively, were not playing Go. They divided the black and white pieces into piles and took turns removing them. They kept silent in response to her questions, so Rikka had to stand there and keep her eyes on the board.

The game looked unexpectedly simple. The red player starts with nn black piles, and the white player starts with mm white piles. They take turns removing any positive number of pieces from one of their own piles. Red moves first. The player who first removes all pieces assigned to them wins, and the other player has to drink.

Drinking is illegal for minors in Japan, so Rikka wonders whether she can ensure a win when she is the red player.

Input

The first line contains an integer T(1≤T≤100)T (1\le T \le 100), the number of test cases. Then TT test cases follow.

Each test case has the following format.

The first line contains two integers n,m(1≤n,m≤100)n,m (1\le n,m \le 100), the numbers of piles of the red and the white player.

The next line contains nn integers ai(1≤ai≤109)a_i (1 \leq a_i \leq 10^9), where each integer is the number of pieces in a black pile of the red player.

The next line contains mm integers bi(1≤bi≤109)b_i (1 \leq b_i \leq 10^9), where each integer is the number of pieces in a white pile of the white player.

Output

Output a string in one line: Yes if the red player, who moves first, can ensure a win, or No otherwise.

Examples1

  1. Example 1

    Input
    2
    3 2
    1 1 1
    2 2
    1 1
    4
    3
    
    Expected output
    No
    Yes