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