#include <bits/stdc++.h>
using namespace std;
const int MX = 11;
int n, l;
int main() {
  scanf("%d", &n);
  while (n) {
    int a = n % 10;
    int b = n % 100;
    int c = n % 1000;
    if (a == 1)
      n /= 10;
    else if (b == 14)
      n /= 10;
    else if (c == 144)
      n /= 100;
    l++;
    if (l > 1000) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
  return 0;
}
