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