#include <bits/stdc++.h>
using namespace std;
int n, m, a[110], b[110];
bool vis[110];
long long ans;
void read(int &x) {
  char ch = getchar();
  int mark = 1;
  for (; ch != '-' && (ch < '0' || ch > '9'); ch = getchar())
    ;
  if (ch == '-') mark = -1, ch = getchar();
  for (x = 0; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - 48;
  x *= mark;
}
int main() {
  read(n);
  read(m);
  for (int i = 1; i <= n; i++) read(a[i]);
  for (int i = 1; i <= m; i++) read(b[i]), vis[b[i]] = 1;
  ans = 0;
  for (int i = 1; i <= n; i++)
    if (vis[i])
      ;
    else
      ans += a[i], a[i] = 0;
  sort(a + 1, a + n + 1);
  for (int i = n; i >= n - m + 1; i--) {
    if (ans > a[i])
      ans = ans * 2;
    else
      ans += a[i];
  }
  printf("%I64d\n", ans);
  return 0;
}
