In how many ways can I arrange 3 different math books and 6 different history books on my bookshelf, if I require there to be a math book on both ends?