#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[200];
int b[200];
vector<int> l;
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < m; ++i) {
    cin >> b[i];
    --b[i];
  }
  long long p = 0;
  for (int i = 0; i < n; ++i) {
    p += a[i];
  }
  l.reserve(m);
  for (int i = 0; i < m; ++i) {
    p -= a[b[i]];
    l.push_back(a[b[i]]);
  }
  sort(l.begin(), l.end());
  long long p2 = p;
  long long p3 = p;
  for (int i = 0; i < l.size(); ++i) {
    if (l[i] < p)
      p *= 2L;
    else
      p += l[i];
  }
  for (int i = l.size() - 1; i >= 0; --i) {
    if (l[i] < p2)
      p2 *= 2L;
    else
      p2 += l[i];
  }
  {
    int lim = l.size();
    for (int i = 0; i < lim; ++i) {
      if (p3 < l[i]) {
        p3 += l[l.size() - 1];
        --lim;
        if (i >= lim) break;
      }
      p3 *= 2L;
    }
  }
  cout << (std::max(p, std::max(p2, p3))) << endl;
  return 0;
}
