A man invests $17,000 in two accounts.one account earns 5% interest per year,and the other earns 6.5%. If the total interest after one year is $970,how much did he invest at each rate?