Phone List

No attempts yetTime limit1sMemory limit256 MB

Problem

You are given a list of phone numbers. Write a program that determines whether the list is consistent.

A list is consistent if no phone number is a prefix of another phone number.

For example, consider the following list of phone numbers:

  • Emergency: 911
  • Sanggeun: 97 625 999
  • Seonyeong: 91 12 54 26

In this case it is impossible to call Seonyeong. The moment you dial the first three digits 911 of Seonyeong's number, you are connected to the emergency line. Therefore this list is not consistent.

Input

The first line contains the number of test cases $t$ ($1 \le t \le 50$).

The first line of each test case contains the number of phone numbers $n$ ($1 \le n \le 10000$).

The next $n$ lines each contain one phone number from the list. Each phone number is at most 10 digits long, and no phone number appears twice in the same list.

Output

For each test case, print YES if the list is consistent, and NO otherwise, each on its own line.