#include <bits/stdc++.h>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    if (n % 10 == 9){
        cout << "YES" << endl;
        return 0;
    }
    n /= 10;
    if (n % 10 == 9){
        cout << "YES" << endl;
        return 0;
    }
    cout << "NO" << endl;
}
