#include <iostream>
#include <vector>
#include <set>
#include <string>
#include <algorithm>
#include <utility>
#include <functional>
#include <queue>
#include <cmath>
#include <numeric>
#include <map>
#define REP(i, N) for(int i=0; i<N; i++)
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 << ((i % 3 == 0) ? "Yes" : "No") << endl;

	return 0;
}
