We report the first detection of C$_2$ $A^1Pi_u$--$X^1Sigma_g^+$ (0,0) and CN $A^2Pi_u$--$X^2Sigma^+$ (0,0) absorption bands in the interstellar medium. The detection was made using the near-infrared (0.91--1.35 $mu$m) high-resolution ($R=20,000$ and 68,000) spectra of Cygnus OB2 No.,12 collected with the WINERED spectrograph mounted on the 1.3 m Araki telescope. The $A$--$X$ (1,0) bands of C$_2$ and CN were detected simultaneously. These near-infrared bands have larger oscillator strengths, compared with the $A$--$X$ (2,0) bands of C$_2$ and CN in the optical. In the spectrum of the C$_2$ (0,0) band with $R=68,000$, three velocity components in the line of sight could be resolved and the lines were detected up to high rotational levels ($Jsim20$). By analyzing the rotational distribution of C$_2$, we could estimate the kinetic temperature and gas density of the clouds with high accuracy. Furthermore, we marginally detected weak lines of $^{12}$C$^{13}$C for the first time in the interstellar medium. Assuming that the rotational distribution and the oscillator strengths of the relevant transitions of $^{12}$C$_2$ and $^{12}$C$^{13}$C are the same, the carbon isotope ratio was estimated to be $^{12}text{C}/^{13}text{C}=50$--100, which is consistent with the ratio in the local interstellar medium. We also calculated the oscillator strength ratio of the C$_2$ (0,0) and (1,0) bands from the observed band strengths. Unfortunately, our result could not discern theoretical and experimental results because of the uncertainties. High-resolution data to resolve the velocity components will be necessary for both bands in order to put stronger constraints on the oscillator strength ratios.