h,w=map(int,input().split())
ok=False
for i in range(h):
    ok|='LOVE' in input()
print('YES' if ok else 'NO')