n,m=map(int,input().split());s='' for _ in '1'*n: s+=input() print('YES' if 'LOVE' in s else 'NO')