Once upon a time when people still believed in magic, there was a great wizard Aranyaka Gondlir. After twenty years of hard training in a deep forest, he had finally mastered ultimate magic, and decided to leave the forest for his home.

Arriving at his home village, Aranyaka was very surprised at the extraordinary desolation. A gloom had settled over the village. Even the whisper of the wind could scare villagers. It was a mere shadow of what it had been.

What had happened? Soon he recognized a sure sign of an evil monster that is immortal. Even the great wizard could not kill it, and so he resolved to seal it with magic. Aranyaka could cast a spell to create a monster trap: once he had drawn a line on the ground with his magic rod, the line would function as a barrier wall that any monster could not get over. Since he could only draw straight lines, he had to draw several lines to complete a monster trap, i.e., magic barrier walls enclosing the monster. If there was a gap between barrier walls, the monster could easily run away through the gap.

For instance, a complete monster trap without any gaps is built by the barrier walls in the left figure, where “M” indicates the position of the monster. In contrast, the barrier walls in the right figure have a loophole, even though it is almost complete.

<image>

Your mission is to write a program to tell whether or not the wizard has successfully sealed the monster.



Input

The input consists of multiple data sets, each in the following format.


n
x1 y1  x'1 y'1
x2 y2  x'2 y'2
...
xn yn  x'n y'n


The first line of a data set contains a positive integer n, which is the number of the line segments drawn by the wizard. Each of the following n input lines contains four integers x, y, x', and y', which represent the x- and y-coordinates of two points (x, y) and (x', y' ) connected by a line segment. You may assume that all line segments have non-zero lengths. You may also assume that n is less than or equal to 100 and that all coordinates are between -50 and 50, inclusive.

For your convenience, the coordinate system is arranged so that the monster is always on the origin (0, 0). The wizard never draws lines crossing (0, 0).

You may assume that any two line segments have at most one intersection point and that no three line segments share the same intersection point. You may also assume that the distance between any two intersection points is greater than 10-5.

An input line containing a zero indicates the end of the input.

Output

For each data set, print “yes” or “no” in a line. If a monster trap is completed, print “yes”. Otherwise, i.e., if there is a loophole, print “no”.

Example

Input

8
-7 9 6 9
-5 5 6 5
-10 -5 10 -5
-6 9 -9 -6
6 9 9 -6
-1 -2 -3 10
1 -2 3 10
-2 -3 2 -3
8
-7 9 5 7
-5 5 6 5
-10 -5 10 -5
-6 9 -9 -6
6 9 9 -6
-1 -2 -3 10
1 -2 3 10
-2 -3 2 -3
0


Output

yes
no
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <vector>
#include <utility>
#include <set>
//#define LOCAL
#define maxv 205
#define maxn 105
#define EPS 1e-10
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
struct Point{
	double x,y;
	Point(double x = 0.0,double y = 0.0): x(x),y(y) {}
	Point operator + (Point p){
		return Point(x + p.x,y + p.y);
	}
	Point operator - (Point p){
		return Point(x - p.x,y - p.y);
	}
	Point operator * (double lambda){
		return Point(x * lambda,y * lambda);
	}
	Point operator / (double lambda){
		return Point(x / lambda,y / lambda);
	}
	double norm(){
		return x * x + y * y;
	}
	double abs_(){
		return sqrt(norm());
	}
	double pol(){
		return atan2(y,x);
	}
	bool operator == (const Point &p)const
	{
		return abs(x - p.x) < EPS && abs(y - p.y) < EPS;
	}
	bool operator < (const Point &p)const
	{
		if(abs(x - p.x) < EPS) return y < p.y;
		else return x < p.x;
	}
};
typedef Point Vector;
struct Segment{
	Point p1,p2;
	Segment(Point p1 = Point(),Point p2 = Point()): p1(p1),p2(p2) {}
};
Point front(Segment s){
	Vector a = s.p2 - s.p1;
	a = a / a.abs_() * 5e-4;
	return s.p2 + a;
}
Point back(Segment s){
	Vector a = s.p2 - s.p1;
	a = a / a.abs_() * 5e-4;
	return s.p1 - a;
}
typedef Segment Line;
typedef vector<Point> Polygon;
double dot(Vector a,Vector b){ return a.x * b.x + a.y * b.y; }
double det(Vector a,Vector b){ return a.x * b.y - a.y * b.x; }
vector <int> adj[maxv];
Point p[maxv]; int pk;
Segment s[maxn]; int n;
int ccw(Point p,Segment l){
	if(det(l.p2 - l.p1,p - l.p1) > EPS) return 1;
	if(det(l.p2 - l.p1,p - l.p1) < -EPS) return -1;
	if(dot(l.p2 - l.p1,p - l.p1) < -EPS) return 2;
	if((l.p2 - l.p1).norm() < (p - l.p1).norm()) return -2;
	return 0;
}
bool cross(Segment s1,Segment s2){
	return ccw(s1.p1,s2) * ccw(s1.p2,s2) <= 0 && ccw(s2.p1,s1) * ccw(s2.p2,s1) <= 0;
}
bool check(Point p1,Point p2){
	for(int i=1;i<=n;i++){
		if(cross(Segment(p1,p2),s[i])) return false;
	}
	return true;
}
bool vis[maxv];
void dfs(int u){
	vis[u] = true;
	for(int i=0;i<(int)adj[u].size();i++){
		int v = adj[u][i];
		if(!vis[v]) dfs(v);
	}
}
int main(){
	#ifdef LOCAL
	freopen("sample.in","r",stdin);
	freopen("sample.out","w",stdout);
	#endif
	while(~scanf("%d",&n) && n){
		for(int i=1;i<=n;i++) scanf("%lf%lf%lf%lf",&s[i].p1.x,&s[i].p1.y,&s[i].p2.x,&s[i].p2.y);
		pk = 0;
		p[++pk] = Point(0,0);
		p[++pk] = Point(100,100);
		for(int i=1;i<=n;i++){
			p[++pk] = front(s[i]);
			p[++pk] = back(s[i]);
		}
		for(int i=1;i<=pk;i++) adj[i].clear();
		for(int i=1;i<=pk;i++){
			for(int j=i+1;j<=pk;j++){
				if(check(p[i],p[j])){
					adj[i].push_back(j);
					adj[j].push_back(i);
				}
			}
		}
		memset(vis,0,sizeof(vis));
		dfs(1);
		if(vis[2]) puts("no");
		else puts("yes");
	}
	return 0;
}

