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