#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> vals(n);
  for (int i = 0; i < n; i++) cin >> vals[i];
  vector<bool> flags(n, false);
  int temp;
  for (int i = 0; i < m; i++) {
    cin >> temp;
    flags[temp - 1] = true;
  }
  long long res = 0;
  vector<int> auction;
  for (int i = 0; i < n; i++) {
    if (flags[i])
      auction.push_back(vals[i]);
    else
      res += vals[i];
  }
  sort(auction.rbegin(), auction.rend());
  for (int i = 0; i < auction.size(); i++) {
    res += max(res, (long long)auction[i]);
  }
  cout << res << endl;
  return 0;
}
