#!/usr/bin/ruby def dfs(a) return to_enum(:dfs,a) if !block_given? yield a[0] if a.size<2 (a.size-1).times{|i| dfs(a[0..i]){|l| dfs(a[i+1..-1]){|r| yield l+r yield l-r yield l*r yield l.is_a?(Rational) || r.is_a?(Rational) ? l/r : Rational(l,r) if r!=0 } } } end n,*a=`dd`.split.map(&:to_i) (3..n).each{|q| a.permutation(q){|b| dfs(b).each{|e| if e==0 puts :YES exit end } } } puts :NO