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