Role of charm in the decay of B mesons to η ′ K