n, m = map(int, input().split()) s = 0 for i in range(0, n): s += input().count('LOVE') print('YNEOS'[not(s)::2])