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()); line=br.readLine(); StringTokenizer st2=new StringTokenizer(line); long ans=0; while(st2.hasMoreTokens()){ int a=Integer.parseInt(st2.nextToken()); ans+=pow_mod_1000003(n,a); } out.println(ans%mod); out.flush(); } } private static long pow_mod_1000003(int n,int a){ if(a==0) return 1; int sum=1; char[] bit=Integer.toBinaryString(a).toCharArray(); for(int i=0;i