P and Y are both endogenous variables and according to the quantity theory of money we need P.Y = constant. If we divide both sides by P we get Y = constant / P. Because Y = YD in the classical model, we can write YD = constant / P. This relationship is sometimes known as 'classical aggregate demand' as it relates real aggregate demand for services and goods YD to the price level P.
Figure: Determination of price level.
Though it is significant to remember that it isn't price adjustments which make aggregate demand equal to aggregate supply in the chart above. Aggregate demand is always equal to aggregate supply by Say's Law. In the classical model, YD isn't determined by P though rather the opposite; P is determined by YD (that is equal to YS) and money supply (which is included in the constant).