N, M = map(int, input().split()) love = sum(input().count('LOVE') for i in range(N)) print('YES' if love else 'NO')