#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(N, 0);
  vector<int> v(N, 0);
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < M; ++i) {
    int p;
    cin >> p;
    p--;
    v[p] = 1;
  }
  vector<int> rem;
  unsigned long long sum = 0;
  for (int i = 0; i < N; ++i) {
    if (v[i] == 0) {
      sum += a[i];
    } else {
      rem.push_back(a[i]);
    }
  }
  sort(rem.rbegin(), rem.rend());
  for (int i = 0; i < rem.size(); ++i) {
    if (sum >= rem[i]) {
      sum = 2 * sum;
    } else {
      sum += rem[i];
    }
  }
  cout << sum << "\n";
  return 0;
}
