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