Problem Statement
You are given a sequence of N−1 integers S=(S1,S2,ldots,SN−1), and M distinct integers X1,X2,ldots,XM, which are called lucky numbers.
A sequence of N integers A=(A1,A2,ldots,AN) satisfying the following condition is called a good sequence.
Ai+Ai+1=Si holds for every i=1,2,ldots,N−1.
Find the maximum possible number of terms that are lucky numbers in a good sequence A, that is, the maximum possible number of integers i between 1 and N such that AiinlbraceX1,X2,ldots,XMrbrace.
Constraints
- 2leqNleq105
- 1leqMleq10
- \-109leqSileq109
- \-109leqXileq109
- X1ltX2ltcdotsltXM
- All values in input are integers.
Input is given from Standard Input in the following format:
N M
S1 S2 ldots SN−1
X1 X2 ldots XM
Output
Print the maximum possible number of terms that are lucky numbers in a good sequence A.
Sample Output 1
A good sequence A=(3,−1,4,−1,5,−9,2,−6,5) contains four terms that are lucky numbers: A2,A4,A5,A9, which is the maximum possible count.
Sample Output 2