def win?(a, i, j, b)
    return false if b.empty?
    return true if a.empty?
    ret = false
    if a.include?(i)
        ret = ! win?(b, i - 1, j, a - [i])
    end
    if !ret && a.include?(j)
        ret = ! win?(b, i, j + 1, a - [j])
    end
    if !ret && !a.include?(i) && !a.include?(j)
        ret = ! win?(b, i, j, a)
    end
    return ret
end
n = gets.to_i
n.times do
    a = gets.split.map(&:to_i)
    puts win?(a, 6, 8, (1..13).to_a - a - [7]) ? 'yes' : 'no'
end
