def METHOD_NAME(mask):
    if type(mask) is not str:
        return False
    for s in mask.split(','):
        if not re.match(r'[0-9]+(-[0-9]+)?', s):
            return False
        if len(s) > 7:
            return False
    return True