Displacive structural phase transitions and the magnetic ground state of quadruple perovskite YMn7O12