Multiplying a [ i ] powe times using Fermat Little Theorem under MODulo MOD for fast exponentiation
unsigned ll mul = power ( a [ i ] , powe ) % MOD ; ans = ( ( ans % MOD ) * ( mul % MOD ) ) % MOD ; } return ans % MOD ; }