#include <bits/stdc++.h>
using namespace std;
long long fastpow(long long a, long long b,
                  long long m = (long long)(1e9 + 7)) {
  long long res = 1;
  a %= m;
  while (b > 0) {
    if (b & 1) res = (res * a) % m;
    a = (a * a) % m;
    b >>= 1;
  }
  return res;
}
long long mulmod(long long a, long long b, long long m = (long long)(1e9 + 7)) {
  long long res = 0;
  a %= m;
  while (b > 0) {
    if (b & 1) res = (res + a) % m;
    a = (a * 2) % m;
    b >>= 1;
  }
  return res;
}
void init() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  ;
}
int32_t main() {
  init();
  long long t = 1;
  while (t--) {
    long long n;
    cin >> n;
    bool flag = true;
    while (n > 0) {
      if (n % 1000 == 144)
        n /= 1000;
      else if (n % 100 == 14)
        n /= 100;
      else if (n % 10 == 1)
        n /= 10;
      else {
        flag = false;
        break;
      }
    }
    if (flag)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
