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