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