def count_ships(field):
    ship_count = {1: 0, 2: 0, 3: 0, 4: 0}

    def sink_ship(x, y):
        if x < 0 or x >= 10 or y < 0 or y >= 10 or field[x][y] != '#':
            return 0
        field[x][y] = '.'
        return 1 + sink_ship(x+1, y) + sink_ship(x-1, y) + sink_ship(x, y+1) + sink_ship(x, y-1)

    for i in range(10):
        for j in range(10):
            if field[i][j] == '#':
                ship_size = sink_ship(i, j)
                if ship_size > 4:
                    return None
                ship_count[ship_size] += 1
                for dx, dy in [(1, 1), (1, -1), (-1, 1), (-1, -1)]:
                    if 0 <= i + dx < 10 and 0 <= j + dy < 10 and field[i + dx][j + dy] == '#':
                        return None

    return ship_count

def is_valid_battlefield(field):
    expected_ship_count = {1: 4, 2: 3, 3: 2, 4: 1}
    actual_ship_count = count_ships(field)
    return actual_ship_count == expected_ship_count


user_board = []

for _ in range(10):
    row = list(input())
    user_board.append(row)


print("YES" if is_valid_battlefield(user_board) else "NO")
