Characterizing the Expressive Power of Invariant and Equivariant Graph Neural Networks