Processing math: 100%
Prefix - MarisaOJ: Marisa Online Judge

Prefix

Time limit: 1000 ms
Memory limit: 256 MB
Given n string S1,S2,...,Sn. Determine if there exists 2 distinct indices i,j that Si is a prefix of Sj. ### Input - The first line contains an integer n. - The next n lines, each line contains a string. ### Output - Print the YES if there exists satisfied indices, NO otherwise. ### Constraints - 1≤n≤105. - 1≤|Si|≤20. - Si contain only lowercase letters. ### Example Input: 3reiμmarisamari Output: YES