//Let's join Kaede Takagaki Fan Club !!
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
#define all(x) x.begin(),x.end()
template<class T>
void dmp(T a){
	rep(i,a.size()) cout << a[i] << " ";
	cout << endl;
}
template<class T>
bool chmax(T&a, T b){
	if(a < b){
		a = b;
		return 1;
	}
	return 0;
}
template<class T>
bool chmin(T&a, T b){
	if(a > b){
		a = b;
		return 1;
	}
	return 0;
}
template<class T>
void g(T &a){
	cin >> a;
}
template<class T>
void o(const T &a,bool space=false){
	cout << a << (space?' ':'\n');
}
//ios::sync_with_stdio(false);
const ll mod = 1000000007;//998244353
template<class T>
void add(T&a,T b){
	a+=b;
	if(a >= mod) a-=mod;
}
int n, a[105], b[105], cnt[205];
bool dp[105];

int main(){
	cin >> n;
	repn(i, n){
		cin >> a[i] >> b[i];
		if(a[i] >= 1) cnt[a[i]]++;
		if(b[i] >= 1) cnt[b[i]]++;
	}
	rep(i, 205){
		if(cnt[i] > 1){
			cout << "No" << '\n';
			return 0;
		}
	}
	dp[0] = 1;
	for(int i=0;i<n;i++){
		if(dp[i] == 0) continue;
		for(int j=i+1;j<=n;j++){
			//[i+1, j]
			int use = 0, blank = 0;
			bool fail = 0;
			repn(k, n){
				if(a[k] == -1 && b[k] == -1){
					blank ++;
				}
				else if(a[k] != -1 && b[k] != -1){
					if(i*2+1 <= a[k] && a[k] <= j*2){
						use++;
						if(a[k]+j-i != b[k]) fail = 1;
					}
					else if(b[k] <= i*2) use++;
				}
				else if(a[k] == -1){
					if(i*2+1 <= b[k] && b[k] <= j*2){
						use++;
						if(i+j+1 <= b[k] && b[k] <= j*2 && cnt[b[k]-(j-i)] == 0);
						else fail = 1;
					}
					else if(b[k] <= i*2) use++;
				}
				else{
					if(i*2+1 <= a[k] && a[k] <= j*2){
						use++;
						if(i*2+1 <= a[k] && a[k] <= i+j && cnt[a[k]+(j-i)] == 0);
						else fail = 1;
					}
					else if(a[k] <= i*2) use++;
				}
			}
			//cout << i << " " << j << " " << use << " " << blank << endl;
			if(use > j) fail = 1;
			if(j-use > blank) fail = 1;
			if(!fail){
				dp[j] = 1;
			}
		}
	}
	cout << (dp[n]?"Yes":"No") << '\n';
}
#include <iostream>
#include <cstdio>
#define N 202
#define int long long
using namespace std;
const int mod=998244353;
const int G=3;
int read()
{
	char c=getchar();
	int w=0,f=1;
	while(c<'0'||c>'9'){
		if(c=='-') f=-1;
		c=getchar();
	}
	while(c<='9'&&c>='0'){
		w=w*10+c-'0';
		c=getchar();	
	}
	return w*f;
}
int n,i,j,a[N],b[N],cnta[N],cntb[N],f[N][N],g[N],r[N],f1[N],g1[N];
bool judge(int l,int r)
{
	int len=(r-l+1)/2+1;
	for(int i=1;i<=n;i++){
		if(a[i]!=-1&&b[i]!=-1){
			if(l<=a[i]&&b[i]<=r&&b[i]-a[i]+1!=len) return 0;
			if(a[i]<l&&b[i]>=l) return 0;
			if(a[i]<=r&&b[i]>r) return 0;
		} 
		else{
			if(a[i]!=-1&&l<=a[i]&&a[i]<=r&&cntb[a[i]+len-1]) return 0;
			if(b[i]!=-1&&l<=b[i]&&b[i]<=r&&cnta[b[i]-len+1]) return 0;
			if(a[i]!=-1&&b[i]!=-1) continue;
		}
	}
	for(int i=l;i+len-1<=r;++i){
		if(cntb[i]||cnta[i+len-1]) return 0;
	}
	return 1;
}
int poww(int a,int b)
{
	int ans=1,base=a;
	while(b){
		if(b&1) ans=ans*base%mod;
		base=base*base%mod;
		b>>=1;
	}
	return ans;
}
void NTT(int *a,int n,int inv)
{
	for(int i=0;i<n;i++){
		if(i<r[i]) swap(a[i],a[r[i]]);
	}
	for(int l=2;l<=n;l<<=1){
		int mid=l/2;
		int cur=poww(G,(mod-1)/l);
		if(inv==-1) cur=poww(cur,mod-2);
		for(int i=0;i<n;i+=l){
			int omg=1;
			for(int j=0;j<mid;j++,omg=omg*cur%mod){
				int tmp=omg*a[i+j+mid]%mod;
				a[i+j+mid]=(a[i+j]-tmp+mod)%mod;
				a[i+j]=(a[i+j]+tmp)%mod;
			}
		}
	}
	if(inv==-1){
		for(int i=0;i<n;i++) a[i]=a[i]*poww(n,mod-2)%mod;
	}
}
void getinv(int *f,int *g,int n)
{
	if(n==1){
		g[0]=poww(f[0],mod-2);
		return;
	}
	getinv(f,g,n/2);
	for(int i=0;i<n;i++) f1[i]=f[i];
	for(int i=0;i<n;i++) g1[i]=g[i];
	int m=2*n,lim=0;
	while((1<<lim)<m) lim++;
	for(int i=0;i<m;i++) r[i]=(r[i>>1]>>1)|((i&1)<<(lim-1));
	NTT(f1,m,1);NTT(g1,m,1);
	for(int i=0;i<m;i++) g1[i]=f1[i]*g1[i]%mod*g1[i]%mod;
	NTT(g1,m,-1);
	for(int i=0;i<n;i++) g[i]=(2*g[i]%mod-g1[i]+mod)%mod;
}
signed main()
{
	n=read();
	for(i=1;i<=n;++i){
		a[i]=read(),b[i]=read();
		if(a[i]!=-1) cnta[a[i]]++;
		if(b[i]!=-1) cntb[b[i]]++;
	}
	for(i=1;i<=2*n;++i){
		if(cnta[i]+cntb[i]>1){ 
			puts("No");
			return 0;
		}
	}
	for(i=1;i<=n;++i){
		if(a[i]!=-1&&b[i]!=-1&&a[i]>b[i]){ 
			puts("No"); 
			return 0; 
		}
	}
	for(i=1;i<=n*2;i+=2){
		for(j=i+1;j<=n<<1;j+=2) f[i][j]=judge(i,j);
	}
	for(i=1;i<=100;i++) 
	g[0]=1;
	for(i=2;i<=2*n;i+=2){
		for(j=0;j<i;j+=2){
			if(f[j+1][i]) g[i]|=g[j];
		}
	}
	if(g[n*2]!=0) puts("Yes");
	else puts("No");
	return 0;
}
