#include <bits/stdc++.h>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
using namespace std;

vector<string> v{
  "8",
  "16",
  "61",
  "24",
  "42",
  "32",
  "23",
  "48",
  "84",
  "56",
  "65",
  "64",
  "46",
  "72",
  "27",
  "88",
  "96",
  "69"
};

bool Solve(string s)
{
  if (find(v.begin(), v.end(), s) != v.end())
    return true;

  sort(s.begin(), s.end());
  rep(i,13,124)
  {
    string t = to_string(i * 8);
    sort(t.begin(), t.end());
    if (s.find(t) != string::npos)
      return true;
  }

  return false;
}

int main() {
  string s;
  cin >> s;
  if (Solve(s)) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int m = 1000000007;

bool check(int n){
	while(n!=0){
		int t = n%10;
		if(t==0){
			return false;
		}
		n = n/10;
	}
	return true;
}

bool check_2(int val, vector<int> arr){
	while(val!=0){
		int t = val%10;
		if(arr[t]>0){
			arr[t]--;
		}
		else{
			return false;
		}
		val = val/10;
	}
	return true;
}
	
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	string s;
	cin>>s;
	vector<int> arr(10,0);
	for(int i=0;i<int(s.size());i++){
		int val = s[i] - '0';
		//cout<<val<<endl;
		arr[val]++;
	}
	if(s.size() == 1){
		if(s[0] == '8')
			cout << "Yes\n";
		else{
			cout << "No\n";
		}
		return 0;
	}
	if(s.size()==2){
		int n1 = (s[0]-'0')*10 + (s[1]-'0');
		int n2 = (s[1]-'0')*10 + (s[0]-'0');
		if(n1 == 16 || n1 == 24 || n1 == 32 || n1 == 56 || n1==48||
			n1 == 64 || n1 == 72 || n1 == 88 || n1 == 96 || n2 == 16 || n2 == 24 || n2 == 32 || n2 == 56 ||
			n2 == 64 || n2 == 72 || n2 == 88 || n2 == 96 ||n2==48){
			cout << "Yes\n";
		}else{
			cout << "No\n";
		}
		return 0;
	}
	//vector<int> v;
	int val = 112;
	while(val<=999){
		if(val%8==0 && check(val)){
			//v.push_back(val);
			if(check_2(val,arr)){
				cout<<"Yes\n";
				return 0;
			}
		}
		val+=8;
	}

	cout<<"No\n";
	return 0;
}