During the holiday season, airports and hotels might be the only places more crowded than malls. Right around Thanksgiving, the number of long-distance trips (classified as 50 miles or more) in America increases by 54 percent. And during the Christmas/New Year’s period, 23 percent more people than average are hitting the road. Airlines and accommodations respond to the crushing demand by upping their prices—but if you’re savvy and book your flight and room right now, you can save a lot of money.

As Hopper reports, the best time to purchase plane tickets for Thanksgiving is anytime before Halloween. Prices will remain stable until the end of October, and after that they will increase around $1.50 per day until the last 10 days before takeoff, when they will rise by around $6 per day. Luckily, flight prices are down 7.8 percent from 2015—but the average cost of a round-trip ticket for the days surrounding Thanksgiving is still $323. If you want to score a discount (and your host has scheduled a late dinner) traveling on Thanksgiving Day is your best bet.

As for Christmas, you want to book your flight ASAP. You’ll get the best deals if you book 80 days prior to departure. Wait, and the average round-trip holiday airfare will rise $1.50 every day until December 25.

Not surprisingly, this timeline also applies for hotels. According to Real Simple, a TripAdvisor survey named the month of November as the least expensive time to make lodging plans for the Christmas/New Year’s season. If you book during this time, costs can be 20 percent lower.

That being said, the optimal time to make Christmas hotel reservations varies by destination. According to TripAdvisor's survey, if you’re staying in Chicago, the best time to book is from October until the end of the year. (During Thanksgiving week, you’ll even see 12 percent savings.) Going to New York? Hopefully you made hotel reservations in mid-September—but if you didn’t, mid-November is your next best bet. And if you’re heading to San Francisco, you likely already missed the 24 percent savings that were offered during mid-September; but don’t worry: Prices will dip again around Thanksgiving week and in December.