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