import re H, W = map(int,input().split()) M = [input() for i in range(H)] reg = re.compile(r'LOVE') for i in range(H): if reg.search(M[i]): print('YES') break else: print('NO')