n,m = map(int,input().split()) flg = False for _ in range(n): s = input() if 'LOVE' in s: flg = True print('YES' if flg else 'NO')