Magnesium and riboflavin during pregnancy?

Br
My neurologist just recomended intake 400 mg each of magnesium and riboflavin. Anyone dont this before and know if its safe? Its to relieve migranes/frequent headaches. I sent my OB a message, but dont anticipate a response until monday sometime