N, M = map(int, raw_input().split()) word = 'LOVE' flag = False for i in range(0, N): s = raw_input() for j in range(0, M-4): for k in range(0, 4): if s[j+k] != word[k]: break if k == 3: flag = True if flag: break if flag: print 'YES' else: print 'NO'