#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
  int N, r = 0;
  cin >> N;
  vector<int> a(N);
  int bitc[32] = {0};
  for (auto& i : a) {
    cin >> i;
    r += i;
  }
  cout << ((r % 3 == 0) ? "Yes" : "No") << endl;
  return 0;
}
