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
import java.io.*;
import java.math.*;
import java.util.*;
import java.util.stream.*;

@SuppressWarnings("unchecked")
public class P320A {

  final static int [] ANS =
    {1, 11, 14, 111, 114, 141, 144, 1111, 1114, 1141, 1144, 1411, 1414, 1441, 11111, 11114, 11141, 11144, 11411,
     11414, 11441, 14111, 14114, 14141, 14144, 14411, 14414, 111111, 111114, 111141, 111144, 111411, 111414,
     111441, 114111, 114114, 114141, 114144, 114411, 114414, 141111, 141114, 141141, 141144, 141411, 141414,
     141441, 144111, 144114, 144141, 144144, 1111111, 1111114, 1111141, 1111144, 1111411, 1111414, 1111441,
     1114111, 1114114, 1114141, 1114144, 1114411, 1114414, 1141111, 1141114, 1141141, 1141144, 1141411, 1141414,
     1141441, 1144111, 1144114, 1144141, 1144144, 1411111, 1411114, 1411141, 1411144, 1411411, 1411414, 1411441,
     1414111, 1414114, 1414141, 1414144, 1414411, 1414414, 1441111, 1441114, 1441141, 1441144, 1441411, 1441414,
     1441441, 11111111, 11111114, 11111141, 11111144, 11111411, 11111414, 11111441, 11114111, 11114114, 11114141,
     11114144, 11114411, 11114414, 11141111, 11141114, 11141141, 11141144, 11141411, 11141414, 11141441, 11144111,
     11144114, 11144141, 11144144, 11411111, 11411114, 11411141, 11411144, 11411411, 11411414, 11411441, 11414111,
     11414114, 11414141, 11414144, 11414411, 11414414, 11441111, 11441114, 11441141, 11441144, 11441411, 11441414,
     11441441, 14111111, 14111114, 14111141, 14111144, 14111411, 14111414, 14111441, 14114111, 14114114, 14114141,
     14114144, 14114411, 14114414, 14141111, 14141114, 14141141, 14141144, 14141411, 14141414, 14141441, 14144111,
     14144114, 14144141, 14144144, 14411111, 14411114, 14411141, 14411144, 14411411, 14411414, 14411441, 14414111,
     14414114, 14414141, 14414144, 14414411, 14414414, 111111111, 111111114, 111111141, 111111144, 111111411, 111111414,
     111111441, 111114111, 111114114, 111114141, 111114144, 111114411, 111114414, 111141111, 111141114, 111141141,
     111141144, 111141411, 111141414, 111141441, 111144111, 111144114, 111144141, 111144144, 111411111, 111411114,
     111411141, 111411144, 111411411, 111411414, 111411441, 111414111, 111414114, 111414141, 111414144, 111414411,
     111414414, 111441111, 111441114, 111441141, 111441144, 111441411, 111441414, 111441441, 114111111, 114111114,
     114111141, 114111144, 114111411, 114111414, 114111441, 114114111, 114114114, 114114141, 114114144, 114114411,
     114114414, 114141111, 114141114, 114141141, 114141144, 114141411, 114141414, 114141441, 114144111, 114144114,
     114144141, 114144144, 114411111, 114411114, 114411141, 114411144, 114411411, 114411414, 114411441, 114414111,
     114414114, 114414141, 114414144, 114414411, 114414414, 141111111, 141111114, 141111141, 141111144, 141111411,
     141111414, 141111441, 141114111, 141114114, 141114141, 141114144, 141114411, 141114414, 141141111, 141141114,
     141141141, 141141144, 141141411, 141141414, 141141441, 141144111, 141144114, 141144141, 141144144, 141411111,
     141411114, 141411141, 141411144, 141411411, 141411414, 141411441, 141414111, 141414114, 141414141, 141414144,
     141414411, 141414414, 141441111, 141441114, 141441141, 141441144, 141441411, 141441414, 141441441, 144111111,
     144111114, 144111141, 144111144, 144111411, 144111414, 144111441, 144114111, 144114114, 144114141, 144114144,
     144114411, 144114414, 144141111, 144141114, 144141141, 144141144, 144141411, 144141414, 144141441, 144144111,
     144144114, 144144141, 144144144};

/*
  boolean check(StringBuilder s) {
    while (s.length() > 0) {
      if ((s.length() >= 3) && (s.charAt(0) == '1') && (s.charAt(1) == '4') && (s.charAt(2) == '4')) {
        s.delete(0, 3);
      } else if ((s.length() >= 2) && (s.charAt(0) == '1') && (s.charAt(1) == '4')) {
        s.delete(0, 2);
      } else if (s.charAt(0) == '1') {
        s.deleteCharAt(0);
      } else {
        return false;
      }
    }

    return true;
  }
*/

  public void run() throws Exception {
    println((Arrays.binarySearch(ANS, nextInt()) >= 0) ? "YES" : "NO");
  }

  public static void main(String... args) throws Exception {
    br = new BufferedReader(new InputStreamReader(System.in));
    pw = new PrintWriter(new BufferedOutputStream(System.out));
    new P320A().run();
    br.close();
    pw.close();
    System.err.println("\n[Time : " + (System.currentTimeMillis() - startTime) + " ms]");
  }

  static long startTime = System.currentTimeMillis();
  static BufferedReader br;
  static PrintWriter pw;
  StringTokenizer stok;

  String nextToken() throws IOException {
    while (stok == null || !stok.hasMoreTokens()) {
      String s = br.readLine();
      if (s == null) { return null; }
      stok = new StringTokenizer(s);
    }
    return stok.nextToken();
  }

  void print(byte b) { print("" + b); }
  void print(int i) { print("" + i); }
  void print(long l) { print("" + l); }
  void print(double d) { print("" + d); }
  void print(char c) { print("" + c); }
  void print(Object o) {
    if (o instanceof int[]) { print(Arrays.toString((int [])o));
    } else if (o instanceof long[]) { print(Arrays.toString((long [])o));
    } else if (o instanceof char[]) { print(Arrays.toString((char [])o));
    } else if (o instanceof byte[]) { print(Arrays.toString((byte [])o));
    } else if (o instanceof short[]) { print(Arrays.toString((short [])o));
    } else if (o instanceof boolean[]) { print(Arrays.toString((boolean [])o));
    } else if (o instanceof float[]) { print(Arrays.toString((float [])o));
    } else if (o instanceof double[]) { print(Arrays.toString((double [])o));
    } else if (o instanceof Object[]) { print(Arrays.toString((Object [])o));
    } else { print("" + o); }
  }
  void print(String s) { pw.print(s); }
  void println() { println(""); }
  void println(byte b) { println("" + b); }
  void println(int i) { println("" + i); }
  void println(long l) { println("" + l); }
  void println(double d) { println("" + d); }
  void println(char c) { println("" + c); }
  void println(Object o) { print(o); println(); }
  void println(String s) { pw.println(s); }
  int nextInt() throws IOException { return Integer.parseInt(nextToken()); }
  long nextLong() throws IOException { return Long.parseLong(nextToken()); }
  double nextDouble() throws IOException { return Double.parseDouble(nextToken()); }
  char nextChar() throws IOException { return (char) (br.read()); }
  String next() throws IOException { return nextToken(); }
  String nextLine() throws IOException { return br.readLine(); }
  int [] readInt(int size) throws IOException {
    int [] array = new int [size];
    for (int i = 0; i < size; i++) { array[i] = nextInt(); }
    return array;
  }
  long [] readLong(int size) throws IOException {
    long [] array = new long [size];
    for (int i = 0; i < size; i++) { array[i] = nextLong(); }
    return array;
  }
  double [] readDouble(int size) throws IOException {
    double [] array = new double [size];
    for (int i = 0; i < size; i++) { array[i] = nextDouble(); }
    return array;
  }
  String [] readLines(int size) throws IOException {
    String [] array = new String [size];
    for (int i = 0; i < size; i++) { array[i] = nextLine(); }
    return array;
  }

  int gcd(int a, int b) {
    return ((b > 0) ? gcd(b, a % b) : a);
  }
  long gcd(long a, long b) {
    return ((b > 0) ? gcd(b, a % b) : a);
  }
}