#include <bits/stdc++.h>
using namespace std;
bool myfun(pair<int, int>& p1, pair<int, int>& p2) {
  if (p1.first > p2.first) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m, x;
  cin >> n >> m;
  vector<pair<int, int>> v;
  for (int i = 0; i < n; i++) {
    cin >> x;
    v.push_back({x, i + 1});
  }
  map<long long, long long> mp;
  for (int i = 0; i < m; i++) {
    cin >> x;
    mp[x] = 1;
  }
  sort(v.begin(), v.end(), myfun);
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    if (mp[v[i].second] == 0) {
      sum += v[i].first;
    }
  }
  for (int i = 0; i < n; i++) {
    if (mp[v[i].second] == 1) {
      if (v[i].first > sum)
        sum += v[i].first;
      else
        sum += sum;
    }
  }
  cout << sum << "\n";
  return 0;
}
