A 4x2' cage would be fine for a yellow anaconda male. They're great snakes, I have three of them, but beware that many of them can be quick to bite. They can become docile, but don't set your heart on it.
As for burms.. my male is around 7' long at a bit over a year old. I don't feed him heavily.. and he will soon need a larger cage.