An orbit in the corner of isosceles right-angled triangle

Is it possible to have a non-escape orbit that is equidistant to two celestial bodies (for example, Earth and Mars) at all times? If possible, how much does it cost to keep an object (which is much smaller than both of the large bodies) in such a trajectory?