newly pregnant and overweight

As

I just found out I was pregnant. I was 130 pounds 2 years ago I'm now 180, is it safe to workout and lose weight while pregnant? is really like to get healthy before the baby comes. obviously not going to try and lose the 50 that I gained though.