def solve():
    line = input().split(' ')
    row = int(line[0])
    col = int(line[1])

    for i in range(row):
        s = input()
        for j in range(col):
            if (j + 3 >= col):
                break
            if (s[j] == 'L' and s[j + 1] == 'O' and s[j + 2] == 'V'
                    and s[j + 3] == 'E'):
                print("YES")
                return

    print("NO")


solve()