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