n,m =map(int, input().split()) for i in range(n): if input().count("LOVE"): print("YES") break elif i == n-1: print("NO")