n,m = map(int,input().split()) src = [input() for i in range(n)] for s in src: if 'LOVE' in s: print('YES') exit() print('NO')