A Derivation of K theory from M theory