#include <bits/stdc++.h>
using namespace std;
void init() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
}
int main() {
  init();
  int n, m, index = 0;
  cin >> n >> m;
  long long maxi = 0;
  pair<int, bool> arr[n];
  int ar[m];
  for (int i = 0; i < n; i++) {
    cin >> arr[i].first;
    arr[i].second = false;
  }
  for (int i = 0; i < m; i++) {
    int index;
    cin >> index;
    arr[index - 1].second = true;
    ar[i] = arr[index - 1].first;
  }
  for (int i = 0; i < n; i++) {
    if (arr[i].second == false) {
      maxi += arr[i].first;
    }
  }
  sort(ar, ar + m);
  reverse(ar, ar + m);
  for (int i = 0; i < m; i++) {
    if (maxi > ar[i]) {
      maxi += maxi;
    } else
      maxi += ar[i];
  }
  cout << maxi;
  return 0;
}
