Partly, although there's a hidden subtlety. Here's the basic glucose balance:
6 CO2 + 6 H2O <=> C6H12O6 + 6 O2
But there's actually some ambiguity in there. In particular, where does the O from the sugar come from and go to? The CO2 or the H2O? You can't tell just by looking at the balance.
It turns out that during photosynthesis, ALL of the oxygen which goes into the sugar comes from the carbon dioxide, and none of it comes from the water. Only the hydrogen comes from water. That's why most of the mass is from air. Had it been the other way around, had all the oxygen come from water and only the carbon from the air, then most of the mass would come from water.