The Yak we have here is a Yak-9U, a late war addition, probably the best performing Yak that saw service in WWII.
I'd be really surprised if
YOU ran over a Yak with a 190A5

(* kiddin' *).
...
Anyway, there are all sorts of claims, witnesses, happenings concerning with gun range and effectiveness(without any sort of hard evidence) that nothing is quite certain up to this point. So, all I can say is just a vague generalization of what seem to go around the boards and accepted as 'common sense'.
Generally, machine guns like .303(7.9mm), .50(12.7mm) hit quite far, but shooting from under 700 yards yields good results. Luftwaffe machineguns seem to drop a lot more, so it is difficult to get any meaningful effect over range of 500 yards.
20mm cannons are mostly all simular, and does critical damage even up to 1000 yards, but chances of hitting are low. They should be fired at about 600 yards range and under. In the case of LW cannons, as it is with machine guns, however, the rounds seem to drop a lot, and getting hits over 400~500 yards is unlikely. Usually people shoot cannons in LW planes around 300 yard range.
Cannons of 30mm and above reaches far, but drops a loooot. There was only one incident I hit something with a MK108 30mm cannon at 650 yards, but after that I have never seen anything like it(it was done at a H2H arena with x10 ammo load

). There are so few rounds of these loaded in planes(32 rounds of 37mms on Yak-9T, 60 rounds of 30mms on 109G-10) that people count the rounds as they shoot 'em. I fire them under 200 yard range.
and...
the 40mm Vicker S cannon on Hurri-IID..
Don't expect to hit anything flying with it. Fire more than two rounds at once and the target immediately goes off. Very big vibration.
..