Dollar attracts safe-haven flows, soars versus yen