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