What OS is it?
Was it preinstalled on the original HP?
Generally speaking, you want to do a clean install of the OS with all new hardware.
And if it was preinstalled on the HP, and Win 8.1 or earlier...it is likely an OEM license, and as such tied to that original motherboard.
Possibly you can sweet talk MS into allowing use of that license on all new hardware, but they are under no obligation to do that.
Lastly...if this is a 'new' build, why the old selection of parts? i5-2400 and the P8H61 is rather old.