Certainly you can, as long as you get married before the I-485 is approved. To be on the safe side, get married before the I-485 (application of adjustment of status) is submitted.