#include <bits/stdc++.h>
using namespace std;
vector<long long int> v;
long long int a, b;
int main() {
  long long int n, a;
  cin >> n >> a;
  long long int dist[n];
  for (long long int i = 1; i <= n; i++) cin >> dist[i];
  long long int ans = dist[a];
  long long int i = 1;
  while (a - i > 0 && a + i <= n) {
    if (dist[a - i] != 0 && dist[a + i] != 0)
      ans += (dist[a - i] + dist[a + i]);
    i++;
  }
  while (a - i > 0) {
    ans += dist[a - i];
    i++;
  }
  while (a + i <= n) {
    ans += dist[a + i];
    i++;
  }
  cout << ans << endl;
  return 0;
}
