Which object has less thermal energy?

 - a cherry pie at a temperature of 30°C
 - a cherry pie at a temperature of 40°C
The two cherry pies have the same mass but different temperatures. Since the 30°C pie is colder than the 40°C pie, it has less thermal energy.