n, m = map(int, input().split()) flag = False for i in range(n): s = input() if flag: continue for j in range(m - 3): if s[j:j + 4] == "LOVE": flag = True if flag: print("YES") else: print("NO")