直接见注释

while True:
    try:
        s = input().split('.')
        result = 'YES'
        for i in s:
            if int(i) < 0 or int(i) > 255: #注意居然有负数的测试用例 #split完是字符,要用int转换之后来判断
                result = 'NO'
                break
        print(result)
        
    except:
        break