#include <bits/stdc++.h>
int main() {
  int n, m, k, p = 1;
  scanf("%d", &n);
  m = n;
  while (m != 0) {
    if (m % 10 == 1) {
      m = m / 10;
      continue;
    }
    if (m % 100 == 14) {
      m = m / 100;
      continue;
    }
    if (m % 1000 == 144) {
      m = m / 1000;
      continue;
    }
    p = 0;
    break;
  }
  if (p == 1)
    printf("YES");
  else
    printf("NO");
  return 0;
}
