#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
void ff() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
void in_out_txt() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
int main() {
  ff();
  int n, m;
  cin >> n >> m;
  pair<long long, long long> pr[100 + 1];
  for (int i = 0; i < n; i++) {
    cin >> pr[i].second;
    pr[i].first = -1;
  }
  int x;
  for (int i = 0; i < m; i++) {
    cin >> x;
    pr[x - 1].first = x - 1;
  }
  sort(pr, pr + n);
  int i = 0;
  long long co = 0;
  while (pr[i].first == -1) co += pr[i++].second;
  vector<long long> vec;
  for (; i < n; i++) vec.push_back(pr[i].second);
  sort(vec.rbegin(), vec.rend());
  for (i = 0; i < vec.size(); i++) {
    if (vec[i] < co)
      co += co;
    else
      co += vec[i];
  }
  cout << co << endl;
  return 0;
}
