#include <bits/stdc++.h>
using namespace std;
int ary[int(1e5 + 10)];
vector<int> vec;
int main() {
  std::ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> ary[i];
  for (int i = 0; i < m; i++) {
    int a;
    cin >> a;
    a--;
    vec.push_back(ary[a]);
    ary[a] = -1;
  }
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    if (ary[i] == -1) continue;
    sum += ary[i];
  }
  sort(vec.begin(), vec.end());
  for (int i = vec.size() - 1; i >= 0; i--) {
    if (sum > vec[i])
      sum *= 2;
    else
      sum += vec[i];
  }
  cout << sum << endl;
  return 0;
}
