n = int(input()) m = int(input()) s_list = [input().strip() for _ in range(m)] # Reverse each string to get the rightmost character as the first element s_reversed = [s[::-1] for s in s_list] # Transpose the reversed strings to get columns columns = [''.join(col) for col in zip(*s_reversed)] # Check if all columns are unique if len(columns) == len(set(columns)): print("Yes") else: print("No")