def is_valid_battleship_field(field):
    ships = {'four': 0, 'three': 0, 'two': 0, 'one': 0}

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

    for y in range(10):
        for x in range(10):
                ship_size = 0
                if x < 9 and field[y][x + 1] == '#':
                    while x < 10 and field[y][x] == '#':
                        ship_size += 1
                        x += 1
                else:
                    while y < 10 and field[y][x] == '#':
                        ship_size += 1
                        y += 1

                if ship_size == 4:
                    ships['four'] += 1
                elif ship_size == 3:
                    ships['three'] += 1
                elif ship_size == 2:
                    ships['two'] += 1
                elif ship_size == 1:
                    ships['one'] += 1
                else:
                    return "NO"

                check_ship(x - 1, y - 1)

    return "YES" if ships['four'] == 1 and ships['three'] == 2 and ships['two'] == 3 and ships['one'] == 4 else "NO"

field = []
for _ in range(10):
    row = list(input())
    field.append(row)

result = is_valid_battleship_field(field)
print(result)
