#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int m, n;
  cin >> n >> m;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int b;
  vector<long long> a1;
  for (int i = 0; i < m; i++) {
    cin >> b;
    a1.push_back(a[b - 1]);
    a[b - 1] = 0;
  }
  sort(a1.begin(), a1.end());
  long long curr = accumulate(a.begin(), a.end(), 0);
  for (int i = m - 1; i >= 0; i--) {
    if (curr > a1[i])
      curr *= 2;
    else
      curr += a1[i];
  }
  cout << curr;
}
