Snuke has a string S consisting of three kinds of letters: `a`, `b` and `c`.

He has a phobia for palindromes, and wants to permute the characters in S so that S will not contain a palindrome of length 2 or more as a substring. Determine whether this is possible.

Constraints

* 1 \leq |S| \leq 10^5
* S consists of `a`, `b` and `c`.

Input

Input is given from Standard Input in the following format:


S


Output

If the objective is achievable, print `YES`; if it is unachievable, print `NO`.

Examples

Input

abac


Output

YES


Input

aba


Output

NO


Input

babacccabab


Output

YES
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;


public class Main {
	
	public static void main(String[] args){
		try(final Scanner sc = new Scanner(System.in)){
			int a_count = 0, b_count = 0, c_count = 0;
			for(final char c : sc.next().toCharArray()){
				switch (c) {
				case 'a': a_count++; break;
				case 'b': b_count++; break;
				case 'c': c_count++; break;
				}
			}
			
			final int sum = a_count + b_count + c_count;
			final int max_count = Math.max(a_count, Math.max(b_count, c_count));
			final int min_count = Math.min(a_count, Math.min(b_count, c_count));
			final int mid_count = sum - max_count - min_count;
			
			if(mid_count == 0){
				if(max_count > 1){
					System.out.println("NO");
				}else{
					System.out.println("YES");
				}
			}else if(mid_count == min_count){
				final int pairs = min_count;
				final int min_place = pairs - 1;
				final int max_place = pairs + 1;
				
				if(max_count < min_place){
					System.out.println("NO");
				}else if(max_count > max_place){
					System.out.println("NO");
				}else{
					System.out.println("YES");
				}
			}else{
				final int pairs = min_count;
				final int single = mid_count - min_count;
				
				if(pairs == 0){
					// b の時 aba はまずい baba もまずい
					if(single >= 2){
						System.out.println("NO");
					}else if(max_count >= 2){
						System.out.println("NO");
					}else{
						System.out.println("YES");
					}
				}else if(single >= 2){
					System.out.println("NO");
				}else{
					final int min_place = pairs;
					final int max_place = pairs + 1;
					if(max_count < min_place){
						System.out.println("NO");
					}else if(max_count > max_place){
						System.out.println("NO");
					}else{
						System.out.println("YES");
					}
				}
			}
		}
	}
	
	public static class Scanner implements AutoCloseable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() {
			try {
				while (!hasNext()) {tok = new StringTokenizer(br.readLine());}
			} catch(IOException e){ /* ignore */ }
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() {
			getLine(); return tok.nextToken();
		}

		public int nextInt(){
			return Integer.parseInt(next());
		}
		public long nextLong(){
			return Long.parseLong(next());
		}
		public double nextDouble(){
			return Double.parseDouble(next());
		}
		
		public int[] nextIntArray(int n){
			int[] ret = new int[n];
			for(int i = 0; i < n; i++){ ret[i] = nextInt(); }
			return ret;
		}
		public long[] nextLongArray(int n){
			long[] ret = new long[n];
			for(int i = 0; i < n; i++){ ret[i] = nextLong(); }
			return ret;
		}
		public double[] nextDoubleArray(int n){
			double[] ret = new double[n];
			for(int i = 0; i < n; i++){ ret[i] = nextDouble(); }
			return ret;
		}

		public void close() {
			try{ br.close(); } catch (IOException e){ /*ignore*/ }
		}
	}
}
