A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and 414 are not.

You're given a number. Determine if it is a magic number or not.

Input

The first line of input contains an integer n, (1 ≤ n ≤ 109). This number doesn't contain leading zeros.

Output

Print "YES" if n is a magic number or print "NO" if it's not.

Examples

Input

114114


Output

YES


Input

1111


Output

YES


Input

441231


Output

NO
#include <bits/stdc++.h>
using namespace std;
const int bfsz = 1 << 16;
char bf[bfsz + 5];
int rsz = 0;
int ptr = 0;
char gc() {
  if (rsz <= 0) {
    ptr = 0;
    rsz = fread(bf, 1, bfsz, stdin);
    if (rsz <= 0) return EOF;
  }
  --rsz;
  return bf[ptr++];
}
void ga(char &c) {
  c = EOF;
  while (!isalpha(c)) c = gc();
}
int gs(char s[]) {
  int l = 0;
  char c = gc();
  while (isspace(c)) c = gc();
  while (c != EOF && !isspace(c)) {
    s[l++] = c;
    c = gc();
  }
  s[l] = '\0';
  return l;
}
template <class first>
bool gi(first &v) {
  v = 0;
  char c = gc();
  while (c != EOF && c != '-' && !isdigit(c)) c = gc();
  if (c == EOF) return false;
  bool neg = c == '-';
  if (neg) c = gc();
  while (isdigit(c)) {
    v = v * 10 + c - '0';
    c = gc();
  }
  if (neg) v = -v;
  return true;
}
long long gcd(long long x, long long y) { return y == 0 ? x : gcd(y, x % y); }
int toInt(char xx) { return xx - '0'; }
char toChar(int xx) { return xx + '0'; }
int isDigit(char xx) { return ('0' <= xx && xx <= '9'); }
void swapInt(int &x, int &y) {
  x = x ^ y;
  y = x ^ y;
  x = x ^ y;
}
const int dx[4] = {-1, 1, 0, 0};
const int dy[4] = {0, 0, -1, 1};
const long long Mod = 1e8 + 1;
const int maxn = 1e6 + 2;
int exitInput = 0;
int ntest = 1, itest = 1;
int n;
string s;
int check() {
  s = "";
  int k;
  while (n) {
    k = n % 10;
    s.push_back(toChar(k));
    n /= 10;
  }
  reverse((s).begin(), (s).end());
  int i, j;
  string t;
  for (i = 0; i < s.size(); ++i) {
    if (s[i] != '1') return 0;
    j = i + 1;
    while (j < s.size() && s[j] != '1') {
      if (s[j] != '4') return 0;
      if (j - i > 2) return 0;
      j++;
    }
    i = j - 1;
  }
  return 1;
}
void read() { gi(n); }
void init() {
  if (check())
    puts("YES");
  else
    puts("NO");
}
void solve() {}
int main() {
  clock_t t1, t2;
  t1 = clock();
  ios_base::sync_with_stdio(0);
  for (itest = 1; itest <= ntest; ++itest) {
    read();
    if (exitInput) {
      break;
    }
    if (itest > 1) {
    }
    init();
    solve();
  }
  t2 = clock();
  return 0;
}
