Consider the following matrix :

I have no problem in constructing the matrix and I have no problem in circling the first and the fifth row, but I have no idea how to insert these arrows outside this matrix. I hope someone can help me out.
Here is what I wrote :
\documentclass[12pt,english]{article}
\usepackage{tikz}
\usetikzlibrary{fit}
\usepackage{nicematrix}
\begin{document}
$$
\begin{bNiceMatrix}%
[code-after = { \tikz \node [draw, rounded corners, fit = (5-1) (5-7)] { }; \tikz \node [draw, rounded corners, fit = (1-1) (1-7)] { } ;}, left-margin = 7pt, right-margin = 7pt]
0 & 0 & 0 & 0 & 1 & \cdots & 0 \\
0 & 1 & 0 & 0 & 0 & \cdots & 0 \\
0 & 0 & \ddots & 0 & 0 & \cdots & 0 \\
0 & 0 & 0 & 1 & 0 & \cdots & 0 \\
1 & 0 & 0 & 0 & 0 & \cdots & 0 \\
0 & 0 & 0 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 1
\end{bNiceMatrix}
$$
\end{document}

