#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  while (n > 0) {
    if (n % 10 == 1)
      n = n / 10;
    else if (n % 100 == 14)
      n = n / 100;
    else if (n % 1000 == 144)
      n = n / 1000;
    else
      break;
    if (n == 0) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
}
