This is basically the argument of Graham and Pollak, likely mentioned in any good introduction to spectral graph theory, which they used to show that a complete graph of order $N$ cannot be partitioned into $N-2$ disjoint complete bipartite graphs.
If the space of positive (respectively negative) eigenvalues had dimension greater than $n,$ it would non-trivially intersect the codimension-$n$ space of vectors orthogonal to all the characteristic vectors of the $Y_i.$ A vector $x$ in this space would satify $x^tAx>0$ (respectively $x^tAx<0$), but the orthogonality implies $x^tAx=0.$