In this paper we study the partition function of the mass deformed ABJM theory on a squashed three sphere. In particular, we focus on the case with the Chern-Simons levels being ±1 and apply a duality between this theory and the \( \mathcal{N} \) = 4 U (N) super Yang-Mills theory with an adjoint hypermultiplet and a fundamental hypermultiplet. For a special mass parameter depending on the squashing parameter, we find that the partition function can be written as that of an ideal Fermi gas with a non-trivial density matrix. By studying this density matrix, we analytically derive the all order perturbative expansion of the partition function in 1/N, which turns out to take the form of the Airy function. Our results not only align with previous findings and conjectures but also lead to a new formula for the overall constant factor of the partition function. We also study the exact values of the partition function for small but finite values of N.