Theoretical studies on the response of interstellar gas to a gravitational potential disc with a quasi-stationary spiral arm pattern suggest that the gas experiences a sudden compression due to standing shock waves at spiral arms. This mechanism, called a galactic shock wave, predicts that gas spiral arms move from downstream to upstream of stellar arms with increasing radius inside a corotation radius. In order to investigate if this mechanism is at work in the grand-design spiral galaxy M51, we have measured azimuthal offsets between the peaks of stellar mass and gas mass distributions in its two spiral arms. The stellar mass distribution is created by the spatially resolved spectral energy distribution fitting to optical and near infrared images, while the gas mass distribution is obtained by high-resolution CO and HI data. For the inner region (r < 150), we find that one arm is consistent with the galactic shock while the other is not. For the outer region, results are less certain due to the narrower range of offset values, the weakness of stellar arms, and the smaller number of successful offset measurements. The results suggest that the nature of two inner spiral arms are different, which is likely due to an interaction with the companion galaxy.