The magic mouse 2 requires OS X El Capitan (10.11) or later. Backup your iMac personal data to Time Machine, and/or an alternative (but restorable) backup solution.
Today (Sept 24) you can sign into the Mac App Store and still download macOS Sierra (10.12.6). Once Apple releases macOS High Sierra (10.13) — and I believe that will be Sept 25, then you will only be able to download and install 10.13. See the next paragraph before you leap...
Ordinarily, these updates to the next major operating system are non-destructive to your personal data, but the first paragraph is nothing to ignore. Before you upgrade, ensure that you have no third-party applications, or printer/scanner drivers that are unsupported on Sierra, or High Sierra. If you are using Microsoft Office 2011 for Mac, it is untested, and unsupported on High Sierra. You will need Office 2016 for Mac v15.35 or later for High Sierra compatibility. Check Roaring Apps for application compatibility. Some applications/drivers will require re-installation.