def ivd_bd(bd):
    def cs(x, y, size, direction):
        if direction == 'horizontal':
            for j in range(y, y + size):
                if j >= 10 or bd[x][j] != '#':
                    return False
                for i in range(max(0, x - 1), min(10, x + 2)):
                    for k in range(max(0, j - 1), min(10, j + 1)):
                        if bd[i][k] == '#':
                            return False
        elif direction == 'vertical':
            for i in range(x, x + size):
                if i >= 10 or bd[i][y] != '#':
                    return False
                for j in range(max(0, y - 1), min(10, y + 2)):
                    for k in range(max(0, i - 1), min(10, i + 1)):
                        if bd[k][j] == '#':
                            return False
        return True
    sc = {4: 1, 3: 2, 2: 3, 1: 4}

    for i in range(10):
        for j in range(10):
            if bd[i][j] == '#':
                if i < 9 and bd[i + 1][j] == '#':
                    if cs(i, j, 2, 'vertical'):
                        sc[2] -= 1
                    else:
                        return "NO"
                elif j < 9 and bd[i][j + 1] == '#':
                    if cs(i, j, 2, 'horizontal'):
                        sc[2] -= 1
                    else:
                        return "NO"
                else:
                    if cs(i, j, 1, 'horizontal'):
                        sc[1] -= 1
                    else:
                        return "YES"

    if all(count == 0 for count in sc.values()):
        return "YES"
    return "NO"
bd = [input() for _ in range(10)]
result = ivd_bd(bd)
print(result)
