Tell them ahead of time and, if possible, place your mat on the edge so it’s easy to leave without disrupting others.
I sometimes worry about this stuff, too, but you’re paying for the class. As long as you’re polite about it, NBD. People have done it in the workout classes I do and I only notice if they’re right next to me. I also don’t care.