You need to set the pin as an output before you use it. 

To do that add the folowing line: 

    GPIO.setup(red, GPIO.OUT)

below the matching lines for green and yellow:

    GPIO.setup(yellow, GPIO.OUT)        ## set output
    GPIO.setup(green, GPIO.OUT)