That would depend on whether you had the copyright owners permission. But probably illegal.
Ideally you needed to buy your PC from a supplier who was willing to supply the o/s disks as well. Some manufacturers like to hide a partition on your hard disk and put the installation files there, but I know from experience this can corrupt, and then you are left in the lurch.
Have you tried contacting the PC manufacturer (or your supplier) and see if you can pay a small fee for the disks you could reasonably argue you should have; since you have paid for the system ?