#include <bits/stdc++.h>
using namespace std;
int single_city(int arr[], int size) {
  int ans = 0;
  for (int i = 0; i < size; i++) {
    ans += arr[i];
  }
  return ans;
}
int two_cities(int arr[], int size) {
  int m = size / 2;
  int ans = 0;
  for (int i = 1; i <= m; i++) {
    if (arr[m - i] == arr[m + i]) {
      ans += (2 * arr[m + i]);
    }
  }
  return ans;
}
int main() {
  int n, a;
  cin >> n >> a;
  int city[n];
  int tc = min((n - a), (a - 1));
  int sc = n - (2 * tc) - 1;
  int criminal;
  for (int i = 0; i < n; i++) {
    cin >> city[i];
  }
  if (tc == (n - a)) {
    criminal = single_city(city, sc);
    criminal += two_cities((city + sc), n - sc);
  } else {
    criminal = single_city((city + n - sc), sc);
    criminal += two_cities(city, n - sc);
  }
  criminal += city[a - 1];
  cout << criminal << endl;
  return 0;
}
