Learning Invariant Molecular Representation in Latent Discrete Space