import java.lang.StringBuilder fun main(args: Array) { val (a,b) = readLine()!!.split(" ").map { it.toInt() } basePow = a val list = readLine()!!.split(" ").map { it.toInt() } val ans = list.map { getPow(it) }.reduce { acc, l -> acc + l } % div println(ans) } var basePow = 2 val div = 1000003 val dic = mutableMapOf() fun getPow(pow:Int):Long { if(pow == 0) { return 1 } dic[pow]?.let { return it } var ans = getPow(pow/2) ans = (ans * ans) % div if(pow % 2 > 0) { ans = (ans * basePow) % div } dic[pow] = ans return ans }