If you have a valid Apple ID and password, you can use the recovery system to reinstall OSX. If you don't have a valid Apple ID or password, you can use a USB drive to install OSX from the recovery system.