We analyze the geometric engineering of the N = 2 SU(2) gauge theories with 1 less than or equal to N-f less than or equal to 3 massive hypermultiplets in the vector representation. The set of partial differential equations satisfied by the periods of the Seiberg-Witten differential is obtained from the Picard-Fuchs equations of the local B-model. The differential equations and its solutions are consistent with the massless case. We show that the Yukawa coupling of the local A-model gives rise to the correct instanton expansion in the gauge theory, and propose the pattern of the distribution of the world-sheet instanton number from it. As a side result, we obtain the asymptotic form of the instanton amplitude in the gauge theories with massless hypermultiplets. (C) 2003 Elsevier B.V. All rights reserved.