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