This is fine mathematics, but calories are an ancient dieting myth that has nothing to do with weight gain and loss.
It has been clearly demonstrated - as long ago as the 1950s - that different foods of equivalent calories have different effects on weight gain and loss.
The human body does not work in the same way as a wood stove, it is far more complicated. To use the word "calories" is to show ignorance of human biochemistry and how it works.
For example, if you eat 10,000 calories a day consisting only of fat, you would LOSE weight - until eventually you would die of starvation.
Read Gary Taubes if you are interested, or not if you believe that conventional wisdom knows everything.