Spectra of local and nonlocal two-dimensional turbulence