
#include <stdio.h>
#include <stdlib.h>
#include <syspes.h>
#include <unistd.h>
char s[1000];
int index;
bool ok;
void C(char c){
if(c=='d') {
return ;
}
else if(c=='c'){
index++;
C(s[index]);
index++;
if(s[index]!='c') ok=false;
}
else ok=false;
}
void B(char c){
if(c=='c'||c=='d') C(s[index]);
else if(c=='b') {
index++;
B(s[index]);
index++;
if(s[index]!='e') ok=false;
}
else ok=false;
}
void S(char c){
if(c=='#') return ;
else if(c=='b'||c=='c'||c=='d') B(s[index]);
else if(c=='a'){
index++;
S(s[index]);
index++;
if(s[index]!='e') ok=false;
}
else ok=false;
}
int main(){
do{
printf("input an string:(end of #)\n");
gets(s);
index=0;
ok=true;
S(s[0]);
if(s[index+1]!='#') ok=false;
if(ok) printf("yes\n");
else printf("no\n");
}while(1);
system("pause");
return 0;
}