You are given a non-negative integer *n*, its decimal representation consists of at most 100 digits and doesn't contain leading zeroes.

Your task is to determine if it is possible in this case to remove some of the digits (possibly not remove any digit at all) so that the result contains at least one digit, forms a non-negative integer, doesn't have leading zeroes and is divisible by 8. After the removing, it is forbidden to rearrange the digits.

If a solution exists, you should print it.
The single line of the input contains a non-negative integer *n*. The representation of number *n* doesn't contain any leading zeroes and its length doesn't exceed 100 digits.
#include <bits/stdc++.h>

using namespace std;

template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::value_type>::type> ostream& operator<<(ostream &os, const T_container &v) { os << '{'; string sep; for (const T &x : v) os << sep << x, sep = ", "; return os << '}'; }
void dbg_out() { cerr << endl; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); }
#ifdef LOCAL
#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
#define dbg(...)
#endif

#define ar array
#define ll long long
#define ld long double
#define sza(x) ((int)x.size())
#define all(a) (a).begin(), (a).end()

#define PI 3.1415926535897932384626433832795l 
const int MAX_N = 1e5 + 5;
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
const ld EPS = 1e-9;

// -------------------------<RNG>------------------------- 
// RANDOM NUMBER GENERATOR
mt19937 RNG(chrono::steady_clock::now().time_since_epoch().count());  
#define SHUF(v) shuffle(all(v), RNG); 
// Use mt19937_64 for 64 bit random numbers.

void solve() {
    // Add your solution here
    string  n;
    cin>>n;
    if (n[-1]=='0'){
        cout<<"YES"<<endl<<0<<endl;
    }
    else if(sza(n)<=2){
        int p=stoi(n);
        if (p%8==0){cout<<"YES"<<endl<<n<<endl;}
        
        else{
            bool flag=true;
            for (int i=0;i<sza(n);i++){
                if (n[i]=='8' or n[i]=='0'){
                    flag=false;
                    cout<<"YES"<<endl<<n[i]<<endl;break;
                }
            }
            if (flag){cout<<"NO"<<endl;}
        }
    }
    else{
        vector <int> lis;
        int x=0;
        while (x<1000){
            lis.push_back(x);
            x+=8;
        }
        bool flag=false;string x_;
        for (auto y:lis){
            int i=0;
            string str=to_string(y);
            int limit=sza(str);
            for (int j=0;j<sza(n);j++){
                if (n[j]==str[i]){
                    i++;
                    if (i==limit){flag=true;x_=str;break;}
                }
            }
            if (flag){break;}
        }
        if (flag){
            cout<<"YES"<<endl;
            string ans;
            for (int i=0;i<sza(n);i++){
                if (n[i]==x_[0]){break;}
                else{
                    ans+=n[i];
                }
            }
            ans+=x_;
            cout<<ans<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }


    }

}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int tc = 1;
    // cin >> tc;
    for (int t = 1; t <= tc; t++) {
        // cout << "Case #" << t << ": ";
        solve();
    }
}
