#include <bits/stdc++.h>

using namespace std;

#define INF 1000000000
#define INFLL 0x3f3f3f3f3f3f3f3fLL 
#define EPS 10e-9
#define MOD 1000000007
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define st first
#define nd second
#define sz(v) int(v.size())
#define all(X) (X).begin(), (X).end()
#define FOR(I, A, B) for(int I = A; I < B; I++)
#define RFOR(I, A, B) for(int I = A; I >= B; I--)

typedef long long ll;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<vii> vvii;
typedef vector<iii> viii;
typedef vector<ll> vll;

ll PD[205][205];

ll comb(ll k, ll n){
	if(k == 0) return 1;
	if(k == n) return 1;
	ll &mem = PD[k][n];
	if(mem != -1) return mem;

	return mem = comb(k-1, n-1) + comb(k, n-1);
}

int main(){
	ll l;
	cin >> l;
	memset(PD, -1, sizeof PD);
	cout << comb(11, l-1) << endl;
	return 0;
}


//Code by Mukul Totla
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
void sublime(){ 
    #ifndef ONLINE_JUDGE 
    freopen ("input.txt", "r", stdin);
    freopen ("output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
      }
  
int main()
{   
   sublime();
   string s;
   ll i;
   cin>>s;
   if(s.length()==1)
   {
    if(s=="8")
      cout<<"Yes";
    else
      cout<<"No";
   }
   else if(s.length()==2)
   {
    map<char,ll>mp;
    for(i=0; i<s.length(); i++)
      mp[s[i]]++;
    int f=0; 
    for(i=16; i<=100; i+=8)
    {
      map<char,ll>m;
      string str=to_string(i);
      m[str[0]]++;
      m[str[1]]++;
      if(mp[str[0]]>=m[str[0]] && mp[str[1]]>=m[str[1]])
      {
        f=1;
        break;
      }
    }
    if(f==1)
      cout<<"Yes";
    else
      cout<<"No";
   }
   else 
   {
    map<char,ll>mp;
    for(i=0; i<s.length(); i++)
      mp[s[i]]++;
    int f=0; 
    for(i=104; i<1000; i+=8)
    {
      map<char,ll>m;
      string str=to_string(i);
      m[str[0]]++;
      m[str[1]]++;
      m[str[2]]++;
      if(mp[str[0]]>=m[str[0]] && mp[str[1]]>=m[str[1]] 
        && mp[str[2]]>=m[str[2]])
      {
        f=1;
        break;
      }
    }
    if(f==1)
      cout<<"Yes";
    else
      cout<<"No";
   }
  return 0;
}