def mean(scores):
    """Returns the average of only valid scores in the given list [0,100]"""
    total = 0
    count = 0
    for score in scores:
        if not(score < 0 or score > 100):
            total += score
            count += 1

    if count == 0:
        return -1

    return total / count