Absolutely. It's a little lengthier process (took me about 20 minutes to do it, then took a while of course for the phone to download all the apps again), but it basically overwrites the phone completely.
Just two caveats, though:
First, be sure to doublecheck your backup/restore settings (under Settings > Backup & reset) to ensure that
Back up my data and
Automatic restore are both toggled "on," and to be certain you know the account to which it's backed up (in case you only set up a gmail account for purposes of originally configuring the phone).
Second, there have been a number of threads stating that the current build of Marshmallow doesn't support Band 12. I don't know if that's only specific to the N6p, or to all devices, but if that's important to you you might want to seek confirmation. I can't speak to it here as I don't know which frequencies my device is connecting on, but I live in an area where my service has always been pretty strong so wouldn't be a good candidate to provide first hand feedback on that.