n, m = (int(i) for i in input().split()) s = [input() for i in range(n)] ans = 0 for i in range(n): if "LOVE" in s[i]: ans += 1; if ans == 1: print("YES") else: print("NO")