#include <bits/stdc++.h>
using namespace std;
string input;
regex rex1("^((1)*(14)*(144)*)*$");
void inputData() {
  cin >> input;
  if (regex_match(input, rex1)) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
int main(int argc, char** argv) { inputData(); }
