#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 113;
int n, a, ans;
int coor[N];
int main() {
  cin >> n >> a;
  for (int i = 1; i <= n; i++) {
    cin >> coor[i];
  }
  for (int i = 1; i < n; i++) {
    if (a + i <= n && a - i > 0) {
      ans += 2 * (coor[a + i] * coor[a - i]);
      continue;
    }
    if (a + i > n && a - i < 1) continue;
    if (a + i > n) {
      ans += coor[a - i];
      continue;
    }
    ans += coor[a + i];
  }
  cout << ans + coor[a];
  return 0;
}
