#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <complex>
#include <vector>
#include <limits>
#include <iomanip>
#include <cassert>
#include <numeric>
#include <chrono>
#include <random>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define debug(x) cerr << #x << " = " << (x) << endl;
#define debug_pii(x) cerr << "(" << x.first << "," << x.second << ")";
#define rep(i, n) for(int i = 0;i < n;i++)
#define pb push_back
#define F first
#define S second

// template<typename _Ty1, typename _Ty2>
// ostream& operator<<(ostream& _os, const pair<_Ty1, _Ty2>& _p) {
//     _os << '(' <<_p.first << ',' << _p.second << ')';
//     return _os;
// }
//
// template<typename _Ty1, typename _Ty2>
// istream& operator>>(istream& _is, pair<_Ty1, _Ty2>& _p) {
//     _is >> _p.first >> _p.second;
//     return _is;
// }

bool dp[105][(int)1e5 + 10];

void solve() {
  int n;cin >> n;
  int sum = 0;
  vector<int> a(n);
  rep(i, n) {
    cin >> a[i];
    sum += a[i];
  }

  for(int i = 0;i <= n;i++) {
    for(int diff = 0;diff <= sum;diff++) {
      if(i == 0) {
        if(diff == 0) dp[i][diff] = true;
      } else {
        if(diff+a[i-1] <= sum) dp[i][diff] |= dp[i-1][diff+a[i-1]];
        if(diff-a[i-1] >= 0) dp[i][diff] |= dp[i-1][diff-a[i-1]];
        if(a[i-1] - diff > 0) dp[i][diff] |= dp[i-1][a[i-1]-diff];
      }
    }
  }

  for(int diff = 0;diff <= sum;diff++) {
    if(dp[n][diff] == true) {
      //x+diff+x = sum
      cout << (sum-diff)/2 + diff << endl;
      return;
    }
  }
}

int main() {

 // freopen("input.in","r",stdin);
 // freopen("output.out","w",stdout);
 // cout << fixed << setprecision(15);

 ios_base::sync_with_stdio(false);
 cin.tie(nullptr);

 int t = 1;
 // cin >> t;
 while (t--) {
   solve();
 }

 return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
using namespace std;
string s;
int cnt[10];
int main() {
	cin>>s;
	for(int i=0;i<(int)s.size();i++)
		cnt[s[i]-'0']++;
	if(s.size()==1){
		if(s[0]=='8')
			puts("Yes");
		else
			puts("No");
		return 0;
	}
	if(s.size()==2){
		for(int i=16;i<100;i+=8){
			int x=i%10,y=i/10;
			cnt[x]--;cnt[y]--;
			if(cnt[x]>=0 && cnt[y]>=0){
				puts("Yes");
				return 0;
			}
			cnt[x]++;cnt[y]++;
		}
		puts("No");
		return 0;
	}
	for(int i=0;i<1000;i+=8){
		int x=i%10,y=(i/10)%10,z=i/100;
		cnt[x]--;cnt[y]--;cnt[z]--;
		if(cnt[x]>=0 && cnt[y]>=0 && cnt[z]>=0){
			puts("Yes");
			return 0;
		}
		cnt[x]++;cnt[y]++;cnt[z]++;
	}
	puts("No");
	return 0;
}
