#include <bits/stdc++.h>
using namespace std;
namespace p413CJeopardy {
void solve(int test_num) {
  int N, M, a[111], was[111], b[33];
  cin >> N >> M;
  for (int i = 0; i < N; i++) cin >> a[i];
  for (int j = 0; j < M; j++) {
    cin >> was[j];
    b[j] = a[--was[j]];
  }
  long long x = 0, y = 0;
  for (int i = 0; i < N; i++) {
    if (find(was, was + M, i) - was == M) {
      x += a[i];
      y += a[i];
    }
  }
  sort(b, b + M);
  for (int j = 0; j < M; j++) x += max(1LL * b[j], x);
  sort(b, b + M, greater<int>());
  for (int j = 0; j < M; j++) y += max(1LL * b[j], y);
  cout << max(x, y) << endl;
}
void solve() { solve(1); }
}  // namespace p413CJeopardy
int main() {
  p413CJeopardy::solve();
  return 0;
}
