/*
NAME: jinxiaoguang
LANG: C++
TASK:
*/
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
//#include <bits/stdc++.h>

using namespace std;
typedef long long LL;
const int inff=0x80000000;
const int infz=0x7fffffff;
const int mod=1e9+7;

int main()
{
int a;
	scanf("%d",&a);
	puts(a/10==9||a%10==9?"YES":"NO");
}
