g=lambda:list(map(int,input().split('.'))) print(['YES','NO'][g()