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