n1,n2 = map(int, input().split()) l = [input() for _ in range(n1)] for i in l: if 'LOVE' in i: print('YES') break else: print('NO')