Which one is grammatically correct?

1. If I were a man, I’d marry you.
2. If I was a man, I’d marry you.

Is there any difference?