r ,c = map(int,(input().split())) list_1 ='' for _ in range(r): list_1 += input() print("YES" if list_1.count("LOVE") >0 else "NO")