Sharma removed opener Upul Tharanga for a duck with just one run on the board, caught behind by Naman Ojha. Yadav had Dimuth Karunaratne caught behind also without scoring, leaving Sri Lanka 2-2.
Dinesh Chandimal made 18 before being caught in the slip by Indian captain Virat Kohli off Sharma with the total on 21.
Kaushal Silva (24) and captain Angelo Mathews (22) were batting sharing unbroken 46 runs for the fourth wicket.
Sri Lanka needs 319 runs to win with seven wickets in hand.
Sharma returned two for 14.
India 329-6 at stumps on day 1 of 3rd test vs. Sri Lanka