# Check the string

A. Check the string

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

A has a string consisting of some number of lowercase English letters 'a'. He gives it to his friend B who appends some number of letters 'b' to the end of this string. Since both A and B like the characters 'a' and 'b', they have made sure that at this point, at least one 'a' and one 'b' exist in the string.

B now gives this string to C and he appends some number of letters 'c' to the end of the string. However, since C is a good friend of A and B, the number of letters 'c' he appends is equal to the number of 'a' or to the number of 'b' in the string. It is also possible that the number of letters 'c' equals both to the number of letters 'a' and to the number of letters 'b' at the same time.

You have a string in your hands, and you want to check if it is possible to obtain the string in this way or not. If it is possible to obtain the string, print "YES", otherwise print "NO" (without the quotes).

Input

The first and only line consists of a string SS (1≤|S|≤50001≤|S|≤5000). It is guaranteed that the string will only consist of the lowercase English letters 'a', 'b', 'c'.

Output

Print "YES" or "NO", according to the condition.

Examples

input

Copy

aaabccc


output

Copy

YES


input

Copy

bbacc


output

Copy

NO


input

Copy

aabc


output

Copy

YES

#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<map>
#include<cmath>
#include<string>
#include<deque>
#include <vector>
using namespace std;
typedef long long ll;
#define PI acos(-1)
#define MAX 0x3f3f3f3f
int main()
{
ll a,b,c,s1=0,s2=0,s3=0,flag=0,i,flag1=0,flag2=0;
string s;
cin>>s;
ll n=s.size();
for(i=0;i<n;i++)
{
if(s[i]=='a')
{
if(s2!=0||s3!=0)
{
flag=1;
break;
}
s1++;
}
if(s[i]=='b')
{
if(s1==0||s3!=0)
{
flag=1;
break;
}
s2++;
}
if(s[i]=='c')
{
if(s1==0||s2==0)
{
flag=1;
break;
}
s3++;
}
}
if(s1==0||s2==0)
flag=1;
if((s1==s3||s3==s2)&&flag==0)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
return 0;
}