#include <bits/stdc++.h>
using namespace std;
int b[1000], a[1000];
int main() {
  int n, m;
  unsigned long long ans = 0;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    ans = ans + a[i];
  }
  for (int i = 1; i <= m; ++i) {
    int x;
    scanf("%d", &x);
    b[i] = a[x];
    ans = ans - a[x];
  }
  sort(b + 1, b + 1 + m);
  for (int i = m; i; --i) {
    if (ans < b[i])
      ans = ans + b[i];
    else
      ans = ans * 2;
  }
  cout << ans << endl;
}
