def check_battleship_field(field):
    ships = [4, 3, 3, 2, 2, 2, 1, 1, 1, 1]  
    for size in ships:
        found = False
        for i in range(10):
            for j in range(10):
                if field[i][j] == '#' and (i + size <= 10 or j + size <= 10):
                    if all(field[i + x][j] == '#' for x in range(size)) or \
                       all(field[i][j + y] == '#' for y in range(size)):
                        found = True
                        if all(field[i + x][j] == '#' for x in range(size)):
                            for x in range(size):
                                field[i + x][j] = '.'
                        else:
                            for y in range(size):
                                field[i][j + y] = '.'
                        break
        if not found:
            return "NO"
    for i in range(10):
        for j in range(10):
            if field[i][j] == '#':
                return "NO"
    return "YES"

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