#include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
int main() {
  bool p = false;
  ll n;
  cin >> n;
  ll a[110000];
  for (ll i = ll(0); i < ll(n); i++) cin >> a[i];
  ll ans = 0;
  if (n >= 4) {
    for (ll i = ll(0); i < ll(n - 2); i++) {
      for (ll j = ll(i + 1); j < ll(n - 1); j++) {
        for (ll k = ll(j + 1); k < ll(n); k++) {
          if ((a[i] + a[j] + a[k]) % 3 == 0) {
            p = true;
            break;
          }
        }
        if (p) break;
      }
      if (p) break;
    }
  }
  if (n = 3) {
    if (((a[0] + a[1] + a[2]) * 2) % 3 == 0) p = true;
  }
  if (p)
    cout << "Yes";
  else
    cout << "No";
}
