Yes, factory resetting is required to remove your account data and settings before handing it over to someone else.