def solve():
    board = []
    for i in range(12):
        board.append(['.','.','.','.','.','.','.','.','.','.','.','.'])

    ships = [0, 10, 6, 3, 1]

    for i in range(10):
        strng = input()
        for j in range(10):
            if strng[j] != '#':
                continue
            elif board[i][j] != '.':
                return 'NO'
            elif board[i+1][j] == '.' and board[i][j+1] == '.' :
                board[i+1][j+1] = 1
                ships[1] -= 1
            elif board[i+1][j] != '.':
                board[i+1][j+1] = board[i+1][j] + 1
                ships[board[i+1][j] + 1] -= 1
            elif board[i][j+1] != '.':
                board[i+1][j+1] = board[i][j+1] + 1
                ships[board[i][j+1] + 1] -= 1
    for i in ships:
        if i != 0:
            return "NO"
    return "YES"

print(solve())