#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k = 0;
  cin >> n;
  while (n > 0) {
    if ((n % 10) == 1) {
      n = n / 10;
      k = 1;
    } else if ((n % 100) == 14) {
      n = n / 100;
      k = 1;
    } else if ((n % 1000) == 144) {
      n = n / 1000;
      k = 1;
    } else {
      k = 0;
      break;
    }
  }
  if (k == 1)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
