Under construction

Still being built. Things may change

Parallelepiped

Time limit2sMemory limit256 MB

Summary
For each set of twelve match lengths, decide whether they can form the edges of a rectangular parallelepiped frame, where four equal edges run along each of the three dimensions.
Level

Easy3 of 10

Topics
Sorting, Greedy, Implementation
Solved
No attempts yet

Problem

Contrary to the well-known saying "matches are not a toy for children," one boy loves playing with matches. He does not play pranks with them or light fires; he solves various puzzles. For example, he can make the number nine equal the number eleven by moving only one match.

Recently this boy's parents gave him several sets, each consisting of twelve matches. The boy started building various geometric figures from them. He has already built many figures, but now he wonders: from which sets is it possible to glue the frame of a parallelepiped using the twelve matches from the set and glue? Matches cannot be broken, and no match may stick out beyond the frame.

Your task is to determine, given the known match lengths for each set, whether the frame of a parallelepiped can be glued from them.

Input

The input contains at most one thousand lines, each of which contains a description of a match set: twelve positive integers not exceeding 10^9. The input ends with a line consisting of twelve zeros; this request does not need to be processed.

Output

For each match set, print "yes" if the frame of a parallelepiped can be glued from it, and "no" otherwise.

Examples1

  1. Example 1

    Input
    1 1 1 1 2 2 2 2 3 3 3 3
    1 1 1 1 2 2 2 2 3 3 3 4
    0 0 0 0 0 0 0 0 0 0 0 0
    
    Expected output
    yes
    no