### BUGGY CODE ###

'''
自宅用PCでの解答
'''
import math
#import numpy as np
import itertools
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)
mod = 200003
dir = [(-1,0),(0,-1),(1,0),(0,1)]
alp = "abcdefghijklmnopqrstuvwxyz"

def dft(f,n,sign=1):
    if len(f) != n:
        f += [0]*(n-len(f))
    if n == 1:
        return f
    f0 = dft(f[0::2],n//2,sign)
    f1 = dft(f[1::2],n//2,sign)
    zeta = complex(math.cos(2*math.pi/n),sign*math.sin(2*math.pi/n))
    pow_zeta = 1
    for i in range(n):
        f[i] = f0[i%(n//2)] + pow_zeta*f1[i%(n//2)]
        pow_zeta *= zeta
    return f

def multiply(g,h):
    n = 2**len(format((len(g)+len(h)+1),'b'))
    g += [0]*(n-len(g))
    h += [0]*(n-len(h))
    gg = dft(g,n)
    hh = dft(h,n)
    ff = [gi*hi for gi,hi in zip(gg,hh)]
    ff = dft(ff,n,-1)
    gh = [int(ffi.real/n+0.1) for ffi in ff]
    return gh

def main():
    n = int(ipt())
    g = 2
    order = [1]
    for i in range(mod-2):
        order.append(order[-1]*g%mod)
    where = [0]*mod
    for i,oi in enumerate(order):
        where[oi] = i

    nms = [0]*(mod-1)
    for i in map(int,ipt().split()):
        if i == 0:
            continue
        nms[where[i]] += 1

    ans = 0
    for i,ni in enumerate(nms):
        ans -= ni*order[(i*2)%(mod-1)]

    nn = multiply(nms*1,nms*1)


    for i in range(2*(mod-1)-1):
        ans += nn[i]*order[i%(mod-1)]

    print(ans//2)

    return None

if __name__ == '__main__':
    main()


### FIXED CODE ###

'''
自宅用PCでの解答
'''
import math
#import numpy as np
import itertools
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)
mod = 200003
dir = [(-1,0),(0,-1),(1,0),(0,1)]
alp = "abcdefghijklmnopqrstuvwxyz"

def dft(f,n):
    if n == 1:
        return f
    f0 = dft(f[0::2],n//2)
    f1 = dft(f[1::2],n//2)
    zeta = complex(math.cos(2*math.pi/n),math.sin(2*math.pi/n))
    pow_zeta = 1
    for i in range(n):
        f[i] = f0[i%(n//2)] + pow_zeta*f1[i%(n//2)]
        pow_zeta *= zeta
    return f

def reverse_dft(f,n):
    if n == 1:
        return f
    f0 = reverse_dft(f[0::2],n//2)
    f1 = reverse_dft(f[1::2],n//2)
    zeta = complex(math.cos(2*math.pi/n),-math.sin(2*math.pi/n))
    pow_zeta = 1
    for i in range(n):
        f[i] = f0[i%(n//2)] + pow_zeta*f1[i%(n//2)]
        pow_zeta *= zeta
    return f

def multiply(g,h):
    n = 2**len(format((len(g)+len(h)+1),'b'))
    g += [0]*(n-len(g))
    h += [0]*(n-len(h))
    gg = dft(g,n)
    hh = dft(h,n)
    ff = [gi*hi for gi,hi in zip(gg,hh)]
    return [int(ffi.real/n+0.1) for ffi in reverse_dft(ff,n)]

def main():
    n = int(ipt())
    g = 2
    order = [1]
    for i in range(mod-2):
        order.append(order[-1]*g%mod)
    where = [0]*mod
    for i,oi in enumerate(order):
        where[oi] = i

    nms = [0]*(mod-1)
    for i in map(int,ipt().split()):
        if i == 0:
            continue
        nms[where[i]] += 1

    ans = 0
    for i,ni in enumerate(nms):
        ans -= ni*order[(i*2)%(mod-1)]

    nn = multiply(nms*1,nms*1)

    for i in range(2*(mod-1)-1):
        ans += nn[i]*order[i%(mod-1)]

    print(ans//2)

    return None

if __name__ == '__main__':
    main()