#include <bits/stdc++.h>
using namespace std;
int arr[1005][1005], r[1005], c[1005];
int main() {
  long long int x, a, b, c;
  cin >> x;
  while (x != 0) {
    a = x % 1000;
    b = x % 100;
    c = x % 10;
    if (a == 144)
      x /= 1000;
    else if (b == 14)
      x /= 100;
    else if (c == 1)
      x /= 10;
    else
      break;
  }
  if (x == 0)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
