Regarding the time complexity of the problem using matrix exponentiation

Sir,
At timestamp 14:21 it is stated that the time complexity of the problem will be O(log N) using exponentiation but how?

using fast exponentiation. any power can be calculated in log(n)

if you don’t know how please read it.

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.