This (as with defense) is kind of outside Google or Yandex's purview.
Said every company serving fascists ever.
No, you can choose to collaborate or you can shut it down.
Collaborators don't get to point back in time and say 'oh we had no choice', even if the choice was a painful one. Sorry it does not work that way.
Yandex is a part of Russia's military. Just the same as Google, MS, Amazon etc. provide services for the US military. Google et al. are probably in the critical path of defence for most European countries as well, insane though that is.