Although pronounced “oh yes,” it has no further tie with those two words.
It was an Old French addition to the law courts of England after the Norman conquest.
In the French of the period it was written oiez, from the verb oir, “to hear.”
Used by the court crier at the opening of the court, or by an officer calling for attention to a proclamation, it meant, “Hear ye! Hear! Hear!”