### subroutines

def o_prod(vx0, vy0, vx1, vy1)
  vx0 * vy1 - vy0 * vx1
end

def cross_segs(ax0, ay0, ax1, ay1, bx0, by0, bx1, by1)
  dax = ax1 - ax0
  day = ay1 - ay0
  dbx = bx1 - bx0
  dby = by1 - by0

  op01 = o_prod(dax, day, dbx, dby)
  return nil if op01 == 0.0

  vx = bx0 - ax0
  vy = by0 - ay0
  op0 = o_prod(vx, vy, dax, day)
  op1 = o_prod(vx, vy, dbx, dby)

  t0 = op1 / op01
  t1 = op0 / op01

  return nil if t0 < 0.0 || t0 > 1.0 || t1 < 0.0 || t1 > 1.0

  [ax0 + dax * t0, ay0 + day * t0]
end

def surrounded?(segs)
  #p ["surrounded?", segs]
  pts = []
  top = segs.last
  segs.reverse.each_cons(2) do |si, sj|
    pts << $sedges[si][sj]
    break if sj == top
  end
  #p ["pts", pts]

  count = 0
  (pts + [pts.first]).each_cons(2) do |p0, p1|
    x0, y0 = p0
    x1, y1 = p1
    if x0 <= 0.0 && x1 > 0.0 || x0 >= 0.0 && x1 < 0.0
      vx = x1 - x0
      vy = y1 - y0
      y = y0 - vy / vx * x0
      count += 1 if y >= 0.0
    end
  end
  (count & 1) == 1
end

def check_rec(prev, u, segs)
  $snbrs[u].select{|v| v != prev}.each do |v|
    if $used[v]
      return true if surrounded?(segs + [v])
    else
      $used[v] = $conn[v] = true
      return true if check_rec(u, v, segs + [v])
      $used[v] = false
    end
  end
  false
end

### main

loop do
  $n = gets.to_i
  break if $n == 0

  segs = $n.times.map{gets.split.map(&:to_f)}
  #p segs

  $sedges = $n.times.map{$n.times.map{nil}}
  $snbrs = $n.times.map{[]}
  
  for i in (0...$n)
    segi = segs[i]
    for j in ((i + 1)...$n)
      segj = segs[j]
      cij = cross_segs(*segi, *segj)
      if cij
        $sedges[i][j] = $sedges[j][i] = cij
        $snbrs[i] << j
        $snbrs[j] << i
      end
    end
  end
  #p $sedges
  #p $snbrs

  ok = false
  $conn = $n.times.map{false}

  for k in (0...$n)
    if ! $conn[k]
      $used = $n.times.map{false}
      $used[k] = true
      ok = check_rec(nil, k, [k])
      break if ok
    end
    break if ok
  end

  puts ok ? 'yes' : 'no'
end