Bob received $14,000 inheritance and divided it between a mutual fund that yielded a yearly return of 5% and a 1-year CD that paid 3.5% annually. If his total earnings for the year on this investment was $640, how much did he invest in each of these two funds?