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