#include <bits/stdc++.h>

using namespace std;

#define x first
#define y second
#define mp make_pair
#define pb push_back
#define sqr(a) ((a) * (a))
#define sz(a) int(a.size())
#define all(a) a.begin(), a.end()
#define forn(i, n) for(int i = 0; i < int(n); i++) 
#define fore(i, l, r) for(int i = int(l); i < int(r); i++)

typedef long long li;
typedef long double ld;
typedef pair<int, int> pt;

template <class A, class B> ostream& operator << (ostream& out, const pair<A, B> &a) {
	return out << "(" << a.x << ", " << a.y << ")";
}

template <class A> ostream& operator << (ostream& out, const vector<A> &v) {
	out << "[";
	forn(i, sz(v)) {
		if(i) out << ", ";
		out << v[i];
	}
	return out << "]";
}

mt19937 rnd(time(NULL));

const int INF = int(1e9);
const li INF64 = li(1e18);
const int MOD = 200003;
const ld EPS = 1e-9;
const ld PI = acos(-1.0);

const int LOGN = 20;
const int N = (1 << LOGN) + 13;

int n;
int a[N];

bool read () {
	if (scanf("%d", &n) != 1)
		return false;
	forn(i, n)
		scanf("%d", &a[i]);
	return true;
}

int add(int a, int b){
	a += b;
	if (a >= MOD)
		a -= MOD;
	if (a < 0)
		a += MOD;
	return a;
}

int mul(int a, int b){
	return a * li(b) % MOD;
}

int binpow(int a, int b){
	int res = 1;
	while (b){
		if (b & 1)
			res = mul(res, a);
		a = mul(a, a);
		b >>= 1;
	}
	return res;
}

struct comp{
	ld x, y;
	
	comp(){};
	
	comp(ld x, ld y) : x(x), y(y) {};
	
	comp(ld x) : x(x), y(0) {};
	
	comp conj(){
		return comp(x, -y);
	}
	
	comp operator +(const comp &b){
		return comp(x + b.x, y + b.y);
	}
	
	comp operator -(const comp &b){
		return comp(x - b.x, y - b.y);
	}
	
	comp operator *(ld b){
		return comp(x * b, y * b);
	}
	
	comp operator *(const comp &b){
		return comp(x * b.x - y * b.y, x * b.y + y * b.x);
	}
	
	comp operator /(ld b){
		return comp(x / b, y / b);
	}
	
	comp operator /(const comp &b){
		return comp((x * b.x + y * b.y) / (b.x * b.x + b.y * b.y),
					(y * b.x - x * b.y) / (b.x * b.x + b.y * b.y));
	}
};

vector<comp> w[LOGN];
vector<int> rv[LOGN];

void prepare(){
	forn(st, LOGN - 1){
		w[st].resize(1 << st);
		forn(i, 1 << st){
			ld ang = PI / (1 << st) * i;
			w[st][i] = comp(cosl(ang), sinl(ang));
		}
	}
	forn(st, LOGN){
		rv[st].resize(1 << st);
		if (st > 0){
			int h = (1 << (st - 1)) - 1;
			forn(i, 1 << st)
				rv[st][i] = (rv[st - 1][i & h] << 1) | (i > h);
		}
	}
}

inline void fft(comp a[N], int n, bool inv){
	int ln = __builtin_ctz(n);
	forn(i, n){
		int ni = rv[ln][i];
		if (i < ni) swap(a[i], a[ni]);
	}
	forn(st, ln){
		int len = 1 << st;
		for (int k = 0; k < n; k += (len << 1))
			fore(pos, k, k + len){
				comp l = a[pos];
				comp r = a[pos + len] * w[st][pos - k];
				a[pos] = l + r;
				a[pos + len] = l - r;
			}
	}
	if (inv){
		forn(i, n)
			a[i] = a[i] / n;
		reverse(a + 1, a + n);
	}
}

void mul(int a[N], int n, int b[N], int m, li ans[N]){
	static comp fp[N], p1[N], p2[N];
	int cnt = n + m;
	while (cnt & (cnt - 1)) ++cnt;
	forn(i, cnt) fp[i] = comp(i < n ? a[i] : 0, i < m ? b[i] : 0);
	fft(fp, cnt, false);
	forn(i, cnt){
		p1[i] = (fp[i] + fp[(cnt - i) % cnt].conj()) / comp(2, 0);
		p2[i] = (fp[i] - fp[(cnt - i) % cnt].conj()) / comp(0, 2);
	}
	forn(i, cnt) fp[i] = p1[i] * p2[i];
	fft(fp, cnt, true);
	forn(i, cnt) ans[i] = li(fp[i].x + 0.5);
}

int pw[N];
int A[N], B[N];
li C[N];

void solve() {
	int cur = 1;
	forn(i, MOD){
		pw[cur] = i;
		cur = mul(cur, 2);
	}
	sort(a, a + n, greater<int>());
	while (n > 0 && a[n - 1] == 0) --n;
	
	forn(i, n) a[i] = pw[a[i]];
	
	memset(A, 0, sizeof(A));
	forn(i, n) ++A[a[i]];
	memcpy(B, A, sizeof(A));
	
	mul(A, MOD, B, MOD, C);
	
	li ans = 0;
	forn(i, 2 * MOD)
		ans += C[i] * binpow(2, i);
	forn(i, n)
		ans -= binpow(2, a[i] + a[i]);
	ans /= 2;
	
	printf("%lld\n", ans);
}

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
	
	int tt = clock();
#endif
	
	cerr.precision(15);
	cout.precision(15);
	cerr << fixed;
	cout << fixed;

	prepare();
	
#ifdef _DEBUG
	while(read()) {	
#else
	if(read()) {
#endif
		solve();
		
#ifdef _DEBUG
	cerr << "TIME = " << clock() - tt << endl;
	tt = clock();
#endif

	}
}

Measured memory_bytes: 87280