Rubik is very keen on number permutations. A permutation a with length n is a sequence, consisting of n different numbers from 1 to n . Element number i (1 ≤ i ≤ n) of this permutation will be denoted as a i . Furik decided to make a present to Rubik and came up with a new problem on permutations. Furik tells Rubik two number permutations: permutation a with length n and permutation b with length m . Rubik must give an answer to the problem: how many distinct integers d exist, such that sequence c (c 1 = a 1 + d, c 2 = a 2 + d, ..., c n = a n + d) of length n is a subsequence of b . Sequence a is a subsequence of sequence b , if there are such indices i 1, i 2, ..., i n (1 ≤ i 1 i 2 i n ≤ m), that a 1 = b i 1 , a 2 = b i 2 , ..., a n = b i n , where n is the length of sequence a , and m is the length of sequence b . You are given permutations a and b , help Rubik solve the given problem.
输入描述:
The first line contains two integers n and m(1 ≤ n ≤ m ≤ 200000) — the sizes of the given permutations. The second line contains n distinct integers — permutation a, the third line contains m distinct integers — permutation b. Numbers on the lines are separated by spaces.


输出描述:
On a single line print the answer to the problem.
示例1

输入

1 1<br />1<br />1<br />1 2<br />1<br />2 1<br />3 3<br />2 3 1<br />1 2 3<br />

输出

1<br />2<br />0<br />
加载中...