import java.io.*; import java.util.StringTokenizer; class Main{ static final PrintWriter out=new PrintWriter(System.out); static final int mod=1000003; public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine())!=null&&!line.isEmpty()){ StringTokenizer st1=new StringTokenizer(line); int n=Integer.parseInt(st1.nextToken()); int m=Integer.parseInt(st1.nextToken()); int[] a=new int[m]; line=br.readLine(); StringTokenizer st2=new StringTokenizer(line); for(int i=0;i0;i--){ if(bit[i]=='1') sum=sum*n%mod; sum=sum*sum%mod; } return sum; } }