Let
(
M
,
d
,
m
)
(M,d,\mathfrak {m})
be a noncompact RCD(0,
N
N
) space with
N
∈
N
+
N\in \mathbb {N}_+
and
supp
m
=
M
\text {supp}\mathfrak {m}=M
. We prove that if the first Betti number of
M
M
equals
N
−
1
N-1
, then
(
M
,
d
,
m
)
(M,d,\mathfrak {m})
is either a flat Riemannian
N
N
-manifold with a soul
T
N
−
1
T^{N-1}
or the metric product
[
0
,
∞
)
×
T
N
−
1
[0,\infty )\times T^{N-1}
, both with the measure a multiple of the
N
N
-dimensional Hausdorff measure
H
N
\mathcal {H}^N
, where
T
N
−
1
T^{N-1}
is a flat torus.