N,M = map(int,input().split()) L = [input() for i in range(N)] for S in L : if "LOVE" in S : ans = "YES" break else : ans = "NO" print(ans)