You are given n strings s1, s2, s3......sn, each of length M, consisting of lowercase English letter.
Here, s[i] are pairwise distinct.
Determine if one can rearrange these strings to obtain a new sequence of strings t1, t2, t3...t4 such that:
for all integers i such that 1 ≤ i < n, one can alter exactly one character of t[i] to another lowercase English letter to make it equal to t[i + 1].
2 ≤ N ≤ 8
1 ≤ M ≤ 5
s[i] is a string of length M consisting of lowercase English letters. (1 ≤ i ≤ N)
s[i] are pairwise distinct.
Print "Yes" if it is possible to obtain a conforming sequence; otherwise, print "No".
8 4 fast face cast race fact rice nice case
Yes