#include <bits/stdc++.h>
using namespace std;
int n, m, k;
vector<int> a, b;
long long sum = 0;
bool cmp(int a, int b) { return (a > b); }
int main() {
  scanf("%d%d", &n, &m);
  a.resize(n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  for (int i = 0; i < m; i++) {
    int pos;
    scanf("%d", &pos);
    b.push_back(a[pos - 1]);
    sum -= a[pos - 1];
  }
  sort(b.begin(), b.end(), cmp);
  for (int i = 0; i < b.size(); i++) {
    if (b[i] < sum)
      sum *= 2;
    else
      sum += (b[i]);
  }
  cout << sum << endl;
  return 0;
}
