n, m= map(int, input().split()) flag = 0 for _ in range(n): s = str(input()) if 'LOVE' in s: flag = 1 if flag == 1: print('YES') else: print('NO')