#include <bits/stdc++.h>
using namespace std;
vector<int> A;
vector<int> B;
vector<int> all;
vector<int> num;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  A.resize(n - m);
  B.resize(m);
  num.resize(m);
  all.resize(n);
  int i, j;
  for (i = 0; i < n; ++i) scanf("%d", &all[i]);
  for (i = 0; i < m; ++i) {
    scanf("%d", &j);
    j--;
    B[i] = all[j];
    all[j] = -1;
  }
  for (i = 0, j = 0; i < n; ++i) {
    if (all[i] != -1) {
      A[j] = all[i];
      j++;
    }
  }
  sort(B.rbegin(), B.rend());
  long long ans = 0;
  for (i = 0; i < n - m; ++i) ans += (long long)A[i];
  for (i = 0; i < m; ++i) ans += max((long long)B[i], ans);
  cout << ans << endl;
  return 0;
}
