#include <bits/stdc++.h>
using namespace std;
bool cmp(int x, int y) { return x > y; }
int nn, n, m, x, a[200], a2[200], vis[200];
long long ans;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i <= m; ++i) {
    scanf("%d", &x);
    vis[x] = 1;
  }
  int n1 = 0, n2 = 0;
  for (int i = 1; i <= n; ++i)
    if (!vis[i]) {
      ans += a[i];
    } else {
      ++nn;
      a2[nn] = a[i];
    }
  sort(a2 + 1, a2 + 1 + nn, cmp);
  for (int i = 1; i <= nn; ++i)
    if (a2[i] < ans)
      ans *= 2;
    else
      ans += a2[i];
  printf("%I64d", ans);
  return 0;
}
