Precise Determinations of the Decay Constants of B and D mesons