#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
priority_queue<long long> q;
long long aa[maxn];
bool fb[maxn];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  long long ans = 0LL;
  for (int i = 1; i <= n; ++i) scanf("%lld", &aa[i]);
  for (int i = 1, b; i <= m; ++i) {
    scanf("%d", &b);
    fb[b] = true;
    q.push(aa[b]);
  }
  for (int i = 1; i <= n; ++i)
    if (!fb[i]) ans += aa[i];
  while (!q.empty()) {
    long long top = q.top();
    q.pop();
    ans += (ans > top) ? ans : top;
  }
  printf("%lld", ans);
  return 0;
}
