#include<stdio.h>
int main() {
int a, b;
int c = 0;
int n;
scanf_s("%d", &n);
while (n>9)
{
a = n % 10;
n = n / 10;
b = n % 10;
if (a > b)
{
c = 1;
}
}
if (c == 1)
{
printf("NO");
}
else
printf("YES");
return 0;
}