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