n,x=map(int,input().split())
m=""
f=0
for i in range(n):
    m+=input()
for j in range(len(m)-3):
    st=m[j]+m[j+1]+m[j+2]+m[j+3]

    if st=="LOVE":
        f=1
        break
if f==1:
    print("YES")
else:
    print("NO")