fork download
  1. gets
  2. ans="No"
  3. ns=gets.split(" ").map{|e| e.to_i}
  4. cs=[0]*200010
  5. ns.each{|e|
  6. cs[e]=1
  7. }
  8. 0.upto(200000){|i|
  9. ans="Yes" if cs[i]+cs[i+3]+cs[i+6]==3
  10. }
  11. puts ans
Success #stdin #stdout 0.04s 9768KB
stdin
8
9 8 11 1 1 6 10 4
stdout
No