def check_battleship_field(field):
    ship_sizes = [4, 3, 3, 2, 2, 2, 1, 1, 1, 1]
    ship_counts = [0] * 10

    for row in field:
        for i in range(len(row)):
            if row[i] == '#':
                if i > 0 and row[i - 1] == '#':
                    return "NO"
                if i < 9 and row[i + 1] == '#':
                    return "NO"
                if row.count('#', i, i + ship_sizes[ship_counts.index(0)]) != ship_sizes[ship_counts.index(0)]:
                    return "NO"
                ship_counts[ship_counts.index(0)] += 1

    return "YES" if all(count == size for count, size in zip(ship_counts, ship_sizes)) else "NO"

field = [input() for _ in range(10)]
result = check_battleship_field(field)
print(result)
