#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0), cout.precision(15);
  int n, a;
  cin >> n >> a;
  vector<int> cities(n + 1, false);
  for (int i = 1; i <= n; ++i) cin >> cities[i];
  int left = a - 1, right = a + 1, ans = cities[a];
  while (left >= 1 && right <= n) {
    if (cities[left] == cities[right]) ans += cities[left] + cities[right];
    --left;
    ++right;
  }
  while (right <= n) {
    ans += cities[right];
    ++right;
  }
  while (left > 0) {
    ans += cities[left];
    --left;
  }
  cout << ans << endl;
  return 0;
}
