Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.

Unfortunately, not all numbers are lucky. Petya calls a number nearly lucky if the number of lucky digits in it is a lucky number. He wonders whether number n is a nearly lucky number.

Input

The only line contains an integer n (1 ≤ n ≤ 1018).

Please do not use the %lld specificator to read or write 64-bit numbers in С++. It is preferred to use the cin, cout streams or the %I64d specificator.

Output

Print on the single line "YES" if n is a nearly lucky number. Otherwise, print "NO" (without the quotes).

Examples

Input

40047


Output

NO


Input

7747774


Output

YES


Input

1000000000000000000


Output

NO

Note

In the first sample there are 3 lucky digits (first one and last two), so the answer is "NO".

In the second sample there are 7 lucky digits, 7 is lucky number, so the answer is "YES".

In the third sample there are no lucky digits, so the answer is "NO".
//package test;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	 public static boolean watermelo(int x) {
		 if(x<3)return false;
		 if(x%2==0) {
			 return true;
		 }else {
			 return false;
		 }
	 }
	 	
 public static int   recurs(int x, int y,int total) {
	 
	 if(x==1&&y==1) {
		 	return total+0;
		 }
	 if(y==1) {
	 	 total=total+(int)x/2;
	 	 return total;
	 }
	 if(y==0) {
		 return total;
	 }
	
	 return recurs(x,y-2,total+x);
	 
 }
 public static  void resp(String[] r) {
	 String fin="";
	 for (int i = 0; i < r.length; i++) {
			fin=fin+r[i];
		}
	for (int i = 0; i < r.length-1; i++) {
		
		if(fin.substring(i, i+1).equals("B")) {
			r[i]=r[i+1];
			r[i+1]="B";
			
		}
	} 
	
 }
 public static String retString(char []x) {
	 String temp="";
	 for (int i = 0; i < x.length; i++) {
		temp=temp+x[i];
	}
	 return temp;
 }
 public static int containss(String [] arr,String x) {
	 int count=0;
	 for (int i = 0; i < arr.length; i++) {
		if(x.equals(arr[i])){
			count++;
			
		}
	}
	 return count;
 }

public static String printStringnaw(String [] arr) {
	String temp="";
	for (int i = 0; i < arr.length; i++) {
		temp=temp+arr[i]+",";
	}
	System.out.println("method");
	return temp;
}
public static String sortString(String inputString) 
{ 
    // convert input string to char array 
    char tempArray[] = inputString.toCharArray(); 
      
    // sort tempArray 
    Arrays.sort(tempArray); 
      
    // return new sorted string 
    return new String(tempArray); 
}
public static void main(String[] args) {
Scanner s =new Scanner(System.in);
String [] x=s.next().split("");
int count=0;
boolean che=true;
for (int i = 0; i < x.length; i++) {
	if(x[i].equals("4")||x[i].equals("7"))count++;
}

String temp=""+count;
String [] y=temp.split("");
for (int i = 0; i < y.length; i++) {

	if(!(y[i].equals("4"))&&!(y[i].equals("7"))) {che=false;
	break;}
}
if(che) {
	System.out.println("YES");
}else {
	System.out.println("NO");
}
//long end=s.nextInt();
//s.nextLine();
//long [] arr=new long[x];
//for (int i = 0; i < x; i++) {
//	arr[i]=s.nextInt();
//}
//Arrays.sort(arr);
//double temp=arr[0];
//double r=0;
//
//for (int i = 0; i < arr.length-1; i++) {
//	 r=arr[i]-arr[i+1];
//	 r=r*-1;
//	
//	r=r/2;
//	
//	if(r>temp) {
//		temp=r;
//	}
//}
//
//r=end-(arr[arr.length-1]);
//r=r/2;
//if(r>temp) {
//	temp=r;
//}
////temp=temp-0.00000000001;
//temp=temp+0.00000000001;
//String y=""+temp;
//System.out.println(y.substring(0, y.length()-1));
//


//BigInteger n = BigInteger.ZERO;
//n=n.add(BigInteger.valueOf(s.nextInt()));
//BigInteger m = BigInteger.ZERO;
//m=m.add(BigInteger.valueOf(s.nextInt()));
//BigInteger a = BigInteger.ZERO;
//a=a.add(BigInteger.valueOf(s.nextInt()));
//BigInteger x=BigInteger.ZERO;
//x=n.divide(a);
//
//BigInteger y=BigInteger.ZERO;
//BigInteger o=BigInteger.ZERO;
//
//y=m.divide(a);
//if(n.mod(a)!=o) {x=x.add(BigInteger.valueOf(1));}
//if(m.mod(a)!=o) {y=y.add(BigInteger.valueOf(1));}
//
//System.out.println(x.multiply(y));
//s.nextLine();
//
//String [] x = s.nextLine().split("");

//for (int j = 0; j < x.length; j++) {
//	int i = Integer. parseInt(x[j]);

//}
//if(i>o){
//	System.out.println("Anton");
//}else{
//	if(o==i){
//		System.out.println("Friendship");
//	}else{
//		System.out.println("Danik");
//	}
//}\

// 
}

private static int recop(int a,int b) {
	if (a==0) return 1;
	if (a==1)return 2;
	if(b>a) return 1;
	System.out.println(a);
	int metha=recop((a/b),b)+1;
	int methb=recop(a,b+1)+1;
	if(metha<methb || b!=1) {
		return metha;
	}else {
		return methb;
	}
}

private static boolean istprime(long arr) {
	long temp=arr;
	
	for (long j = 2; j < (temp/2)+1; j++) {
	
		if(arr%j==0) {
			
			if((long)j*j==arr)return true;
			else return false;
			
		}
	}
	return false;
}
}
