The long-range collective flow of particles produced in oxygen-oxygen (
O
+
O
) and neon-neon (
Ne
+
Ne
) collisions is measured with the CMS detector at the CERN LHC. The data samples were collected at a center-of-mass energy per nucleon pair of 5.36 TeV, with integrated luminosities of
7
nb
−
1
and
0.8
nb
−
1
for
O
+
O
and
Ne
+
Ne
collisions, respectively. Two- and four-particle azimuthal correlations are measured over nearly five units of pseudorapidity. Significant elliptic (
v
2
) and triangular (
v
3
) flow harmonics are observed in both systems. The ratios of
v
n
coefficients between
Ne
+
Ne
and
O
+
O
collisions suggest sensitivity to the intrinsic nuclear structure of the respective Ne and O ions. Hydrodynamic models with nuclear structure inputs qualitatively reproduce the collision-overlap dependence of both the
v
n
values and the
Ne
+
Ne
to
O
+
O
ratios. These measurements provide new constraints when modeling the interplay of nuclear structure and collective dynamics in collisions of
O
16
and
Ne
20
ions, respectively.