i=lambda:list(map(int,input().split('.'))) print('YNEOS'[i()