Spectrum and Energy Efficiency Optimization in IRS-Assisted UAV Networks