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