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