#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> arr;
  int k;
  long long int sumi = 0;
  for (int y = 0; y < n; y++) {
    cin >> k;
    arr.push_back(k);
    sumi += k;
  }
  vector<int> kol;
  vector<int> yup;
  for (int i = 0; i < m; i++) {
    cin >> k;
    sumi -= arr[k - 1];
    kol.push_back(arr[k - 1]);
  }
  sort(kol.begin(), kol.end());
  for (int y = m - 1; y >= 0; y--) {
    if (sumi > kol[y]) {
      sumi = 2 * sumi;
    } else {
      sumi = sumi + kol[y];
    }
  }
  cout << sumi << endl;
}
