N, M = map(int, input().split()) ok = 0 for i in range(N): if "LOVE" in input(): ok = 1 print("YES"*ok or "NO")