#line 1 "c.cpp"
// -----------------------------------
// author   : MatsuTaku
// country  : Japan
// created  : 08/09/20 20:58:21
// -----------------------------------

#include <bits/stdc++.h>

#line 3 "/mnt/c/Users/tkmma/competitive_programming/CPBF/library/include/modular.hpp"

template <long long MOD>
class Modular {
 private:
  long long val_;

 public:
  constexpr Modular() : val_(0) {}
  constexpr Modular(long long v) : val_(v%MOD) {
    if (val_ < 0) val_ += MOD;
  }

  constexpr long long val() const { return val_; }
  constexpr Modular operator+(Modular x) const { return (val() + x.val())%MOD; }
  constexpr Modular operator+=(Modular x) { return *this = *this + x; }
  constexpr Modular operator++() { return *this += 1; }
  constexpr Modular operator++(int) { Modular c = *this; ++(*this); return c; }
  constexpr Modular operator-(Modular x) const { return (val() + MOD - x.val())%MOD; }
  constexpr Modular operator-=(Modular x) { return *this = *this - x; }
  constexpr Modular operator--() { return *this -= 1; }
  constexpr Modular operator--(int) { Modular c = *this; --(*this); return c; }
  constexpr Modular operator*(Modular x) const { return (val() * x.val())%MOD; }
  constexpr Modular operator*=(Modular x) { return *this = *this * x; }
  friend constexpr Modular pow(Modular x, long long p) {
    Modular t = 1;
    Modular u = x;
    while (p) {
      if (p & 1)
        t *= u;
      u *= u;
      p >>= 1;
    }
    return t;
  }
  constexpr Modular operator/(Modular x) const { return *this * pow(Modular{x}, MOD-2); }
  constexpr Modular operator/=(Modular x) { return *this = *this / x; }

  constexpr bool operator==(Modular x) const { return val() == x.val(); }
  constexpr bool operator!=(Modular x) const { return val() != x.val(); }
  constexpr bool operator<(Modular x) const { return val() < x.val(); };
  constexpr bool operator<=(Modular x) const { return val() <= x.val(); };
  constexpr bool operator>(Modular x) const { return val() > x.val(); };
  constexpr bool operator>=(Modular x) const { return val() >= x.val(); };

  friend std::ostream& operator<<(std::ostream& os, const Modular& x) {
    return os << x.val();
  }
  friend std::istream& operator>>(std::istream& is, Modular& x) {
    return is >> x.val_;
  }

};

#line 4 "/mnt/c/Users/tkmma/competitive_programming/CPBF/library/include/fft.hpp"

class Fft {
 public:
  using complex_t = std::complex<double>;
  using value_type = complex_t;
 private:
  size_t n_;

 public:
  explicit Fft(size_t size) {
    n_ = 1;
    while (n_ < size)
      n_ *= 2;
  };

  size_t n() const { return n_; }

  void fft_inline(std::vector<complex_t>& f) const {
    _fft(f);
  }

  std::vector<complex_t> fft(const std::vector<complex_t>& f) const {
    auto ff = f;
    ff.resize(n_, 0);
    _fft(ff);
    return ff;
  }

  void ifft_inline(std::vector<complex_t>& f) const {
    _ifft(f);
  }

  std::vector<complex_t> ifft(const std::vector<complex_t>& f) const {
    auto ff = f;
    ff.resize(n_, 0);
    _ifft(ff);
    return ff;
  }

 private:
  template <bool Forward>
  void _fft_impl(std::vector<complex_t>& f) const {
    // iterative bit reversal
    for (size_t i = 0, j = 1; j < n_-1; j++) {
      for (size_t k = n_ >> 1; k > (i ^= k); k >>= 1);
      if (i < j) std::swap(f[i], f[j]);
    }
    // Cooley-Tukey FFT
    for (size_t m = 1; m < n_; m *= 2) {
      double theta0 = Forward ? M_PI/m : -M_PI/m;
      for (size_t chunk = 0; chunk < n_; chunk += 2*m) {
        for (size_t i = 0; i < m; i++) {
          complex_t w = {cos(theta0*i), -sin(theta0*i)};
          auto p = chunk + i;
          auto a = f[p + 0];
          auto b = f[p + m] * w;
          f[p + 0] = a + b;
          f[p + m] = a - b;
        }
      }
    }
  }

  void _fft(std::vector<complex_t>& f) const {
    _fft_impl<true>(f);
  }
  void _ifft(std::vector<complex_t>& f) const {
    _fft_impl<false>(f);
    for (auto& x : f) {
      x /= n_;
    }
  }

};

#line 2 "/mnt/c/Users/tkmma/competitive_programming/CPBF/library/include/convolution.hpp"

template <typename Transformer>
class Convolution {
 public:
  using Polynomial = std::vector<typename Transformer::value_type>;
 private:
  Transformer tf_;
 public:
  explicit Convolution(size_t size) : tf_(size) {}

  Polynomial operator()(const Polynomial& g, const Polynomial& h) const {
    auto fg = tf_.fft(g);
    auto fh = tf_.fft(h);
    for (size_t i = 0; i < tf_.n(); i++) {
      fg[i] *= fh[i];
    }
    tf_.ifft_inline(fg);
    return fg;
  }

};

#line 12 "c.cpp"

using namespace std;
using ll = long long;
static constexpr int MOD = 200003;
using Mint = Modular<MOD>;

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);

  int r = 2;
  while (true) {
    Mint m = 1;
    bool ok = true;
    for (int i = 0; i < MOD-2; i++) {
      m *= r;
      if (m == 1) {
        ok = false;
        break;
      }
    }
    if (ok)
      break;
  }
  array<int, MOD> vtoi = {};
  {
    Mint m = 1;
    for (int i = 0; i < MOD-1; i++) {
      vtoi[m.val()] = i;
      m *= r;
    }
  }

  Convolution<Fft>::Polynomial cnt(MOD);
  ll ans = 0;
  int n; cin>>n;
  for (int i = 0; i < n; i++) {
    int a; cin>>a;
    if (a == 0) continue;
    cnt[vtoi[a]] += 1;
    ans -= (ll) a * a % MOD;
  }
  auto cnvcnt = Convolution<Fft>(MOD*2)(cnt, cnt);
  {
    Mint m = 1;
    for (auto v:cnvcnt) {
      ans += m.val() * lround(v.real());
      m *= r;
    }
  }
  assert(ans % 2 == 0);
  ans /= 2;
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 27156