The word يا is just what you use when addressing people in questions. It essentially is what is used in Arabic instead of a comma like in the English translation.
Here are some examples:
ماذا تظن عن هذا يا امير؟ What do you think about that, Amir?
هل هذا صحيح يا نعيمة؟ Is that correct, Naima?
It's like saying : O' maha O' people... It's a way of calling. It's used a lot in religious books