n, m = map(int, input().split()) def f(): for i in range(n): if 'LOVE' in input(): return 'YES' return 'NO' print(f())