Dollar gains on higher yields, risky currencies weaken