H, W = map(int, input().split()) for i in range(H): s = input() for j in range(W-3): if s[j:j+4] == 'LOVE': print('YES') exit() print('NO')