/*
 * Team Names - John Buck
 * GNY Regional
 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

int main(int argc, char **argv)
{
	char szLine[128], *s, *send;
	bool bCorrect = false;
	int n;

	if(::fgets(&(szLine[0]), sizeof(szLine)-1, stdin) != NULL){
		n = ::strlen(&(szLine[0]));
		/* Trim trailing <LF>, <CR> */
		for(s = &(szLine[n]); --s >= &(szLine[0]) && (*s == '\r' || *s == '\n'); ){
			;
		}
		*++s = '\0';
		send = s;
		/* New length */
		n = s - &(szLine[0]);
		/* Break into school and team */
		s = strchr(&(szLine[0]), '-');
		if(s != NULL){
			/* Make sure school is correct length */
			n = s - &(szLine[0]);
			if(n >= 2 && n <= 8){
				s++;
				n = send - s;
				if(n >= 1 && n <= 24){
					bCorrect = true;
				}
			}
		}
	}	
	printf("%s\n", bCorrect ? "YES" : "NO");
	return 0;
}

