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 } val ans = (getPow(pow-1) * basePow) % div dic[pow] = ans return ans }