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