I took AP CS AB back in the day concurrent with Algebra II/Trig. There's not a ton of math to AP CS - that comes later in college when you have to apply logic (sort of geometry, although formal and boolean logic are more helpful) and discrete math to your CS.
But I don't know if these days AP CS A builds on the AP CS Principals class that didn't exist back when it was AP CS AB.
My kids' school doesn't require Principals before CS A, for what it's worth.