# http://yukicoder.me/problems/433 # No.199 星を描こう class Point attr_accessor :x, :y def initialize(x_, y_) self.x = x_ self.y = y_ end end def cross(a, b) (a.x * b.y - a.y*b.x) end def cross2(a, b, o) cross(Point.new(a.x-o.x, a.y-o.y), Point.new(b.x-o.x, b.y-o.y)) end points = [] N = 5 N.times{ x, y = gets.split.map(&:to_i) points << Point.new(x,y) } allok = true (0...N).each{|i| #puts "======= i=#{i} =========" o = points[i] ok = false (0...N).each{|j| #puts " ======= j=#{j} =========" if j == i next end a = points[j] failed = false (0...N).each{|k| #puts " ======= k=#{k} =========" if(k==j || k==i) next end b = points[k] if cross2(a, b, o)>0 #puts "cross2 ok" else failed = true #puts "cross2 ng" end } if failed == false ok = true #puts "ok=true" end } allok &&= ok } if allok puts "YES" else puts "NO" end