flag = False
n,m = map(int,input().split())
for i in range(n):
    flag |= input().count('LOVE')
print('YES' if flag else 'NO')