#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  unsigned long long a[n], b[n], c[n], sz = 0, ans = 0;
  memset(c, 0, sizeof c);
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < m; ++i) {
    int x;
    cin >> x;
    b[sz++] = a[x - 1];
    c[x - 1] = 1;
  }
  sort(b, b + sz);
  for (int i = 0; i < n; ++i)
    if (!c[i]) ans += a[i];
  for (int i = sz - 1; i >= 0; --i) {
    if (ans > b[i])
      ans *= 2;
    else
      ans += b[i];
  }
  cout << ans << endl;
  return 0;
}
