Viruses
The Committee for Binary Virus Research has identified that certain sequences of ones and zeros function as virus codes. They have compiled a list of these virus codes. A sequence of ones and zeros is considered safe if none of its substrings (i.e., sequences of consecutive elements) matches any of the virus codes. The committee's current objective is to determine whether there is an infinite sequence of ones and zeros that remains safe.
Input
The input begins with a single integer N, representing the total number of virus codes. Each of the next N lines contains a non-empty string consisting of the characters 0 and 1, each representing a virus code. The combined length of all these strings does not exceed 30000.
Output
The output should be a single line containing the word:
YES - if there exists an infinite safe sequence of zeros and ones;
NO - if no such sequence exists.