8VC Venture Cup 2017 - Elimination Round
B
PolandBall and Game
Codeforces
1100
原题
← AC →
翻译中…

PolandBall is playing a game with EnemyBall. The rules are simple. Players have to say words in turns. You cannot say a word which was already said. PolandBall starts. The Ball which can't say a new word loses.

翻译中…

You're given two lists of words familiar to PolandBall and EnemyBall. Can you determine who wins the game, if both play optimally?

翻译中…

Input

翻译中…

The first input line contains two integers $*n*$ and $*m*$ ($1 ≤ *n*, *m* ≤ 10^{3}$) — number of words PolandBall and EnemyBall know, respectively.

翻译中…

Then $*n*$ strings follow, one per line — words familiar to PolandBall.

翻译中…

Then $*m*$ strings follow, one per line — words familiar to EnemyBall.

翻译中…

Note that one Ball cannot know a word more than once (strings are unique), but some words can be known by both players.

翻译中…

Each word is non-empty and consists of no more than $500$ lowercase English alphabet letters.

翻译中…

Output

翻译中…

In a single line of print the answer — "YES" if PolandBall wins and "NO" otherwise. Both Balls play optimally.

翻译中…

Note

翻译中…

In the first example PolandBall knows much more words and wins effortlessly.

翻译中…

In the second example if PolandBall says kremowka first, then EnemyBall cannot use that word anymore. EnemyBall can only say wiedenska. PolandBall says wadowicka and wins.

翻译中…

样例

Input #1
5 1
polandball
is
a
cool
character
nope
Output #1
YES
InputCopy OutputCopy
Input #2
2 2
kremowka
wadowicka
kremowka
wiedenska
Output #2
YES
InputCopy OutputCopy
Input #3
1 2
a
a
b
Output #3
NO
InputCopy OutputCopy
题目信息
题号
755B
时间限制
1 s
内存限制
256 MB
标签
二分
数据结构
博弈论
贪心
排序
字符串

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。