i;main(s){i=scanf("%d%3s",&i,&s)>puts(i>3|s%95%49%3?"YES":"NO");}