n, m = map(int, input().split()) if m < 4: print("NO") else: found = False for _ in range(n): s = input().strip() if 'LOVE' in s: found = True break print('YES' if found else 'NO')