Vova's house is an array consisting of n elements (yeah, this is the first problem, I think, where someone lives in the array). There are heaters in some positions of the array. The i-th element of the array is 1 if there is a heater in the position i, otherwise the i-th element of the array is 0.

Each heater has a value r (r is the same for all heaters). This value means that the heater at the position pos can warm up all the elements in range [pos - r + 1; pos + r - 1].

Vova likes to walk through his house while he thinks, and he hates cold positions of his house. Vova wants to switch some of his heaters on in such a way that each element of his house will be warmed up by at least one heater. 

Vova's target is to warm up the whole house (all the elements of the array), i.e. if n = 6, r = 2 and heaters are at positions 2 and 5, then Vova can warm up the whole house if he switches all the heaters in the house on (then the first 3 elements will be warmed up by the first heater and the last 3 elements will be warmed up by the second heater).

Initially, all the heaters are off.

But from the other hand, Vova didn't like to pay much for the electricity. So he wants to switch the minimum number of heaters on in such a way that each element of his house is warmed up by at least one heater.

Your task is to find this number of heaters or say that it is impossible to warm up the whole house.

Input

The first line of the input contains two integers n and r (1 ≤ n, r ≤ 1000) — the number of elements in the array and the value of heaters.

The second line contains n integers a_1, a_2, ..., a_n (0 ≤ a_i ≤ 1) — the Vova's house description.

Output

Print one integer — the minimum number of heaters needed to warm up the whole house or -1 if it is impossible to do it.

Examples

Input

6 2
0 1 1 0 0 1


Output

3


Input

5 3
1 0 0 0 1


Output

2


Input

5 10
0 0 0 0 0


Output

-1


Input

10 3
0 0 1 1 0 1 0 0 0 1


Output

3

Note

In the first example the heater at the position 2 warms up elements [1; 3], the heater at the position 3 warms up elements [2, 4] and the heater at the position 6 warms up elements [5; 6] so the answer is 3.

In the second example the heater at the position 1 warms up elements [1; 3] and the heater at the position 5 warms up elements [3; 5] so the answer is 2.

In the third example there are no heaters so the answer is -1.

In the fourth example the heater at the position 3 warms up elements [1; 5], the heater at the position 6 warms up elements [4; 8] and the heater at the position 10 warms up elements [8; 10] so the answer is 3.
#include <bits/stdc++.h>
const long long kot = LLONG_MAX;
using ld = long double;
const int MAXIT = 100;
const long long int alpha = 1e18;
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int powe(long long int x, unsigned long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
bool isPerfectSquare(long double x) {
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);
}
bool comp(long long int a, long long int b) { return (a < b); }
vector<long long int> ve;
void divisors(long long int n) {
  for (long long int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        ve.push_back(i);
      else
        ve.push_back(i);
      ve.push_back(n / i);
    }
  }
}
long long int modInverse(long long int a, long long int m) {
  long long int g = gcd(a, m);
  return powe(a, m - 2, m);
}
bool isPrime(long long int n) {
  if (n == 1) {
    return false;
  }
  long long int i = 2;
  while (i * i <= n) {
    if (n % i == 0) {
      return false;
    }
    i += 1;
  }
  return true;
}
long long int gcdofarray(vector<long long int>& v, long long int n) {
  long long int result = v[0];
  for (long long int i = 1; i < n; i++) result = gcd(v[i], result);
  return result;
}
long long int sumofdigits(long long int n) {
  long long int sum = 0;
  while (n > 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
bool powertwo(long long int x) { return x && (!(x & (x - 1))); }
string removeDuplicatesFromString(string str) {
  long long int counter = 0;
  long long int i = 0;
  long long int size = str.size();
  long long int x;
  long long int length = 0;
  while (i < size) {
    x = str[i] - 97;
    if ((counter & (1 << x)) == 0) {
      str[length] = 'a' + x;
      counter = counter | (1 << x);
      length++;
    }
    i++;
  }
  return str.substr(0, length);
}
long long int commDiv(long long int a, long long int b) {
  long long int n = gcd(a, b);
  long long int result = 0;
  for (long long int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        result += 1;
      else
        result += 2;
    }
  }
  return result;
}
long long int fact(long long int n) {
  if (n <= 1) return 1;
  return n * fact(n - 1);
}
long long int nPr(long long int n, long long int r) {
  return fact(n) / fact(n - r);
}
long long int kash(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
long long int maxi(long long int a, long long int b) { return (a > b) ? a : b; }
long long int mini(long long int a, long long int b) { return (a < b) ? a : b; }
long long int nCr(long long int n, long long int r) {
  return fact(n) / (fact(r) * fact(n - r));
}
bool sortByVal(const pair<long long int, long long int>& a,
               const pair<long long int, long long int>& b) {
  return (a.second < b.second);
}
long long int check(long long int arr[], long long int n, long long int v) {
  long long int dp[v + 1];
  dp[0] = 0;
  long long int i, j;
  for (i = 1; i <= v; i++) {
    dp[i] = INT_MAX;
  }
  for (i = 1; i <= v; i++) {
    for (j = 0; j < n; j++) {
      if (arr[i] <= i) {
        long long int y = dp[i - arr[j]];
        if (y != INT_MAX && y + 1 < arr[i]) {
          dp[i] = y + 1;
        }
      }
    }
  }
  return dp[v];
}
long long int maxSubArraySum(long long int a[], long long int size) {
  long long int max_so_far = INT_MIN, max_ending_here = 0;
  for (long long int i = 0; i < size; i++) {
    max_ending_here = max_ending_here + a[i];
    if (max_so_far < max_ending_here) max_so_far = max_ending_here;
    if (max_ending_here < 0) max_ending_here = 0;
  }
  return max_so_far;
}
bool isvowel(char ch) {
  if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') {
    return true;
  }
  return false;
}
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long int inverse(long long int x, long long int p) {
  long long int res = power(x, 998244353 - 2, 998244353);
  return res;
}
long long int nCrModPFermat(long long int n, long long int r, long long int p) {
  if (r == 0) return 1;
  long long int fac[n + 1];
  fac[0] = 1;
  for (long long int i = 1; i <= n; i++) fac[i] = fac[i - 1] * i % p;
  return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) %
         p;
}
long long int parent[100001];
long long int find(long long int a) {
  while (parent[a] > 0) {
    a = parent[a];
  }
  return a;
}
void Union(long long int a, long long int b) {
  parent[a] += parent[b];
  parent[b] = a;
}
bool ispalind(string str) {
  string s = str;
  if (s == str) return true;
  return false;
}
string intToBinaryString(long long int n) {
  char bArray[(sizeof(long long int) * 8) + 1];
  unsigned index = sizeof(long long int) * 8;
  char temp = 0;
  bArray[index] = '\0';
  do {
    temp = (n & 1);
    temp = temp + '0';
    bArray[--index] = temp;
  } while (n >>= 1);
  return string(bArray + index);
}
vector<long long int> len;
void dfs(long long int i, map<long long int, bool>& visited,
         map<long long int, list<long long int>>& adjList, long long int p) {
  if (visited[i]) return;
  visited[i] = true;
  len.push_back(p);
  for (long long int j : adjList[i]) {
    if (!visited[j]) dfs(j, visited, adjList, p + 1);
  }
}
bool check(long long int arr[], long long int n) {
  long long int i, c = 0;
  for (i = 0; i < n; i++) {
    if (arr[i] == 1) {
      c++;
    }
  }
  if (c == n) {
    return true;
  }
  return false;
}
void solve() {
  long long int tt = 1;
  for (long long int d = 0; d < tt; d++) {
    long long int n, r;
    cin >> n >> r;
    long long int i, j;
    vector<long long int> arr(n + 1);
    for (i = 1; i <= n; i++) {
      cin >> arr[i];
    }
    bool flag = 1;
    long long int c = 0;
    for (i = 1; i <= n; i++) {
      bool first = 0;
      for (j = mini(i + r - 1, n); j >= maxi(0, i - r + 1); j--) {
        if (arr[j] == 1) {
          c++;
          i = j + r - 1;
          first = 1;
          break;
        }
      }
      if (!first) {
        flag = 0;
        break;
      }
    }
    if (!flag) {
      cout << "-1";
    } else {
      cout << c << "\n";
    }
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  solve();
}
