시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 512 MB | 10 | 6 | 6 | 60.000% |
Katya's old dream to be in the "Wheel of Fortune" game has come true.
Let's remind the rules of the "Wheel of Fortune" game:
The host of the game hides the word of length $L$. Katya really wanted to win the game, so she hacked the game editor's computer. She found out that the hidden word will be one of $N$ words.
Katya has the first turn in the game. Help Katya to understand if she can guarantee to win the game. Is it true that Katya will be able to guess any word from the stolen list without loosing the turn?
In the first line there are two integers $L$ and $N$ --- the length of the hidden word and the number of stolen words ($1 \le L \le 10^6$, $1 \le N \le 10^5$).
In the next $N$ lines there are different words of length $L$. They consist of lowercase English letters.
It is guaranteed that the total length of all words does not exceed $10^6$.
Output "YES
", if Katya is able guarantee herself a win, otherwise output "NO
".
5 2 hello world
YES
4 4 idea play game warm
YES
4 2 game name
NO
In the first sample Katya can win, if she first names the letter "l
". Seeing the opened letters, she can determine he hidden word.
In the third sample for all Katya's strategies there is a risk of naming a wrong letter and loosing the turn.