#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 4;
const int inf = 1e9 + 1;
const long long OO = 1e18;
long long points;
bool id[101];
int main() {
  int n, m, idx, p[101];
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> p[i];
  for (int i = 0; i < m; i++) cin >> idx, id[idx - 1] = 1;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    if (id[i])
      v.push_back(p[i]);
    else
      points += p[i];
  }
  sort(v.begin(), v.end());
  for (int i = (int)v.size() - 1; i >= 0; i--) {
    if (points > v[i])
      points += points;
    else
      points += v[i];
  }
  cout << points;
  return 0;
}
