// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <cctype>

#include <cmath>

#include <ctime>

#include <algorithm>

#include <utility>

#include <functional>

#include <string>

#include <vector>

#include <set>

#include <map>

#include <queue>

#include <stack>

#include <bitset>

using namespace std;

typedef long long ll;



const int N = 1e5 + 5, INF = 0x3f3f3f3f;



struct P

{

	ll dif; int id;

	P(ll dif = 0, int id = -1) :dif(dif), id(id) {}

	P operator + (const P &a) const { return P(dif + a.dif, id); }

	bool operator < (const P &a) const { return dif > a.dif; }

};



P p[N];

int n, ans, loc[N];

ll L, a[N], b[N], c[N], d[N];



ll ok(int mid, int i)

{

	if (i <= mid) return p[mid].dif - a[p[i].id] + b[p[i].id];

	return p[mid].dif;

}



int main()

{

	while (~scanf("%d%lld", &n, &L))

	{

		for (int i = 0; i < n; i++)

		{

			scanf("%lld%lld", &a[i], &b[i]);

			p[i] = P(a[i] - b[i], i);

		}

		for (int i = 0; i < n; i++)

		{

			scanf("%lld", &c[i]);

			if (i) c[i] += c[i - 1];

		}

		sort(p, p + n);

		for (int i = 0; i < n; i++)

			loc[p[i].id] = i;

		int fu = n - 1;

		for (; fu >= 0 && p[fu].dif <= 0; fu--);

		for (int i = 1; i < n; i++)

			p[i] = p[i] + p[i - 1];

		ans = INF;

		for (int i = 0; i < n; i++)

		{

			ll len = L - a[i];

			int l = -1, r = fu;

			if (len <= 0) { ans = min(ans, 1); continue; }

			while (r - l > 1)

			{

				int mid = l + r >> 1;

				if (ok(mid, loc[i]) < len) l = mid;

				else r = mid;

			}

			int now = r - (r >= loc[i]), v = ok(r, loc[i]);

			if (v >= len&& v > c[now])

				ans = min(ans, now + 2);

		}

		printf("%d\n", ans == INF ? -1 : ans);

	}

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 13.469382446109197x):
#include<stdio.h>

#include<string.h>

#include<algorithm>

using namespace std;



const int maxn=1e6+5;

const int imax=1e6;

const int inf=999999999;

int en,n,a[maxn],b[maxn];

typedef long long ll;

ll tree[maxn],sum[maxn],c[maxn];



/*struct node

{

	int x,id;

//	node(int x,int id):x(x),id(id){}

}p[maxn];*/



struct node

{

    int x,id;

    node(){}

    bool operator < (const node &a) const

    {

        if(a.x==x) return id<a.id;

        return x>a.x;

    }

}p[maxn];



bool cmp(node a,node b)

{

	return a.x==b.x?a.id<b.id:a.x>b.x;

}





void build(int l,int r,int rt)

{

	if(l==r)

	{

		tree[rt]=sum[l]-c[l-1];

		return ;

	}

	int mid=(l+r)>>1;

	build(l,mid,rt*2);

	build(mid+1,r,rt*2+1);

	tree[rt]=min(tree[rt*2],tree[rt*2+1]); 

}



ll qu(int L,int R,int l,int r,int rt)

{

	if(L>R)	return inf;

	if(r<L||l>R)	return inf;

	if(l>=L&&r<=R)	return tree[rt];

	int mid=(l+r)>>1;

	int a1=inf,a2=inf;

	a1=qu(L,R,l,mid,rt*2);

	a2=qu(L,R,mid+1,r,rt*2+1);

	return min(a1,a2);

}



bool check(int i,int mid)

{

    if(i>mid) return sum[mid]+a[p[i].id]>=en;

    return sum[mid]-p[i].x+a[p[i].id]>=en;

}





int main()

{

	int ans=inf;

	c[0]=0;

	sum[0]=0;

	scanf("%d%d",&n,&en);

	for(int i=1;i<=n;++i)

	{

		scanf("%d%d",a+i,b+i);

		p[i].x=a[i]-b[i];

		p[i].id=i;

	}

	for(int i=1;i<=n;++i)

	{

		scanf("%lld",c+i);

		c[i]+=c[i-1];

	}

	sort(p+1,p+1+n,cmp);

	for(int i=1;i<=n;++i)	sum[i]=sum[i-1]+p[i].x;

	build(1,n,1);

	int gg=n;

	for(int i=1;i<=n;++i)

	{

		if(p[i].x<0)

		{

			gg=i;

			break;

		}

		

	}

	gg++;

	int num=1;

	while(sum[num]>c[num])

	{

		if(num>n)	break;

		num++;

	}

	for(int i=1;i<=n;++i)

	{

		int l=0,r=n+1;

		while(l<r)

		{

			int mid=(l+r)/2;

			if(check(i,mid))	r=mid;

			else l=mid+1;

		}

		if(r>n)	continue;

		if(r<i)

		{

			if(r<num)	ans=min(ans,r+1);

		}

		else

		if(qu(i+1,r,1,n,1)>p[i].x)	ans=min(ans,r);

	}

	if(ans==inf)	printf("-1\n");

	else printf("%d\n",ans);

	return 0;

}