Yes it is balanced. This is because the 2 (coefficient) in front of the Magnesium means there are a total of 2 magnesium atoms. The O2 means there is also 2 oxygen atoms. You can only change coefficients when balancing equations. If an element doesn’t have a coefficient before, there is only one. There is no need to change O2 coefficient since the little 2 means there are already two oxygen. This equation is balanced already due to the elements equally adding up to 2 of each in the end. This process is called synthesis.