def is_valid_battleship_field(field):
    if sum(row.count('#') for row in field) != 10:
        return "NO"

    for i in range(10):
        for j in range(10):
            if field[i][j] == '#':
                if i < 0 or i > 9 or j < 0 or j > 9:
                    return "NO"
                for dx in [-1, 0, 1]:
                    for dy in [-1, 0, 1]:
                        if 0 <= i + dx < 10 and 0 <= j + dy < 10 and field[i + dx][j + dy] == '#':
                            return "NO"

    return "YES"

field = [input().strip() for _ in range(10)]

result = is_valid_battleship_field(field)
print(result)
