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>
long long dx[4] = {-1, 0, 1, 0};
long long dy[4] = {0, -1, 0, 1};
long long mod = 1e9 + 7;
long long inf = INT_MAX;
using namespace std;
bool isPrime(long long n) {
  long long j;
  for (j = 2; j <= sqrt(n); j++) {
    if (n % j == 0) {
      break;
    }
  }
  if (j > sqrt(n)) {
    return 1;
  } else {
    return 0;
  }
}
long long modexpo(long long a, long long b) {
  long long ans = 1;
  a = a % mod;
  while (b > 0) {
    if ((b & 1) == 1) {
      ans = ((ans % mod) * (a % mod)) % mod;
    }
    b = b >> 1;
    a = ((a % mod) * (a % mod)) % mod;
  }
  return ans;
}
long long invmod(long long n) { return modexpo(n, mod - 2); }
long long comb(long long n, long long r) {
  if (r == 0) {
    return 1;
  }
  long long fact[n + 1];
  fact[0] = 1;
  for (long long i = 1; i <= n; i++) {
    fact[i] = (fact[i - 1] * i) % mod;
  }
  return (fact[n] * invmod(fact[r]) % mod * invmod(fact[n - r]) % mod) % mod;
}
long long gcd(long long a, long long b) {
  if (a == 0) {
    return b;
  }
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) {
  return ((a / gcd(a, b)) * (b / gcd(a, b))) * gcd(a, b);
}
bool sortbysecdesc(const pair<long long, long long> &a,
                   const pair<long long, long long> &b) {
  return a.second > b.second;
}
bool prime[1000005];
void sieve(int n) {
  memset(prime, true, sizeof(prime));
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
}
vector<long long> adj[100005];
bool visited[100005];
void dfs(long long i) {
  visited[i] = 1;
  for (auto j : adj[i]) {
    if (visited[j] == 0) {
      dfs(j);
    }
  }
}
void solve(long long k) {
  string n;
  cin >> n;
  map<string, long long> m;
  queue<string> q;
  q.push("1");
  q.push("14");
  q.push("144");
  while (q.size() != 0) {
    string a = q.front();
    q.pop();
    m[a] = 1;
    a += '1';
    if (a.size() <= 9) {
      q.push(a);
    }
    a += '4';
    if (a.size() <= 9) {
      q.push(a);
    }
    a += '4';
    if (a.size() <= 9) {
      q.push(a);
    }
  }
  if (m[n]) {
    cout << "YES"
         << "\n";
    return;
  }
  cout << "NO"
       << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  long long k = 1;
  while (k <= t) {
    solve(k);
    k++;
  }
  return 0;
}
