N,_=gets.split(" ").map{|i| i.to_i}
A=gets.split(" ").map{|i| i.to_i}
B=gets.split(" ").map{|i| i.to_i}
Asum = A.inject{|sum,a| sum+a}
Bsum = B.inject{|sum,b| sum+b}
if (Asum < Bsum)
	puts -1
	exit 0
end
AminB = Array.new(N) { |i| 0 }
for i in 0..(N-1)
	AminB[i] = A[i] - B[i]
end
AminB_positive_sorted = AminB.reject{|n| n < 0}.sort{|n,m| n <=> m}
maxdif = Asum - Bsum
i = 0
cnt = 0
# p AminB_positive_sorted
# p maxdif
while(maxdif >= 0 && i <= AminB_positive_sorted.size-1)
	if(AminB_positive_sorted[i] <= maxdif)
		maxdif -= AminB_positive_sorted[i]
		cnt += 1
		i += 1
	else
		puts N-cnt
		exit 0
	end
end
if(i == AminB_positive_sorted.size)
		puts N-cnt
		exit 0
end
puts N



