def is_valid_battleship_field(field):
    ship_counts = [0, 4, 3, 2, 1]
    for row in field:
        for cell in row:
            if cell == '#':
                ship_counts[0] += 1

    if ship_counts != [0, 1, 2, 3, 4]:
        return "NO"

Û    for i in range(10):
        for j in range(10):
            if field[i][j] == '#':
                if (j == 0 or field[i][j - 1] == '.') and (j == 9 or field[i][j + 1] == '.'):
                    ship_length = 1
                    for k in range(j + 1, 10):
                        if k < 10 and field[i][k] == '#':
                            ship_length += 1
                        else:
                            break
                    if ship_length not in [1, 2, 3, 4]:
                        return "NO"
                    ship_counts[ship_length] -= 1
                elif (i == 0 or field[i - 1][j] == '.') and (i == 9 or field[i + 1][j] == '.'):
                    ship_height = 1
                    for k in range(i + 1, 10):
                        if k < 10 and field[k][j] == '#':
                            ship_height += 1
                        else:
                            break
                    if ship_height not in [1, 2, 3, 4]:
                        return "NO"
                    ship_counts[ship_height] -= 1
                else:
                    return "NO"
    
    return "YES" if all(count == 0 for count in ship_counts) else "NO"

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