How is b = B%p-1

In the video, how can b=B%p-1

Just comparing the terms, please carefully go through the terms and explanation.
Video time : 5:30
Its explained in the video very well how we are getting on to every step of derivation.

I am not able to understand. Is it by taking mod on both sides:
We know that B = a*p-1 + b

Taking mod p-1 on both sides , we get

B % p-1 = (a*p-1 % p-1 + b % p-1) % p-1
B%p-1 = (0 + b%p-1) %p-1
B%p-1 = b?
How can it be equal?

We want that B shall be divided in the form of k(p-1)+c
So that we can apply fermets theoram on first part easily and rest, we need to calculate A^c % p only.
Any number can be written in the form of this
x = a*(x/a) + x%a right?
Take example 16 = 3*(16/3) + 16%3
16 = 3*5 + 1 = 16.

So in the theoram, we are doing the same thing. Substitute (p-1) as a in the above thing.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.