n,m = map(int,input().split()) r = "NO" for i in range(n): s = input() if "LOVE" in s: r = "YES" print(r)