#!/usr/bin/python # -*- coding: utf-8 -*- # † # (ΦωΦ)< # 交点が5つあるかどうかでいいですか? from collections import namedtuple Point = namedtuple('Point', 'x, y') xys = [] for _ in xrange(5): x, y = map(float, raw_input().split()) xys.append(Point(x, y)) from itertools import permutations from itertools import izip, tee, islice def pairwise(iterable): "s -> (s0,s1), (s1,s2), (s2,s3), ..." a, b = tee(iterable) next(b, None) return izip(a, b) for x in permutations(xys): x = list(x) y = x + [x[0]] sett = set() for i in xrange(5): a, b, c, d = (i+1)%5, (i+2)%5, (i+3)%5, (i+4)%5 a, b, c, d = x[a], x[b], x[c], x[d] bunbo = (b.x - a.x) * (d.y - c.y) - (b.y - a.y) * (d.x - c.x) if bunbo == 0: continue ac = Point(c.x - a.x, c.y - a.y) dr = ((d.y - c.y) * ac.x - (d.x - c.x) * ac.y) / bunbo if 0 < dr < 1: px = a.x + dr * (b.x - a.x) py = a.y + dr * (b.y - a.y) sett.add(Point(px, py)) # print sett if len(sett) == 5: print 'YES' exit(0) print 'NO'