Adjacency matrix and connectivity proof

Let $G$ be graph on $n$ vertices, $A$ its adjacency matrix, and $I_{n}$ the $n\times n$ identity matrix. Prove that $G$ is connected iff the matrix $(I_{n} + A)^{n-1}$ has no 0s.

My proof:

If the graph is connected the matrix $(I_{n} + A)^{n-1}$ has no 0s.

The identity matrix takes care of the non-zero values for the diagonal (otherwise the diagonals would be 0 since self-loops are disallowed in simple graphs).
If the graph is connected there must exist a path between any two vertices $u,v \in G$. $A^{n-1}_{i,j}$ represents the number of paths of length $n-1$ between any two vertices. If any $A^{n-1}_{i,j}$ would be 0, that would mean that there would not be any path connecting those vertices. Thus, the graph would be disconnected. But we assumed that it was connected

If the matrix $(I_{n} + A)^{n-1}$ has no 0s then G is connected

If every $(I_{n} + A)^{n-1}$ is non-zero this means that there exists at least one path of length $n – 1$ between any two vertices. If this is the case, the graph must be connected.

Is this correct?

Solutions Collecting From Web of "Adjacency matrix and connectivity proof"