#include <stdio.h>
#include <stdlib.h>

int main()
{
    int N, b1, b2;
    scanf("%d",&N);
    b1 = N/10;
    b2 = N%10;
    if (b1 == 9 || b2 == 9)
    {
        printf("YES\n");
    }
    else
    {
        printf("NO\n");
    }
    return 0;
}
