#include <bits/stdc++.h>
using namespace std;
long long maxi(long long &a, long long b) {
  if (b > a) {
    a = b;
    return 1;
  }
  return 0;
}
long long mini(long long &a, long long b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
long long mini(long double &a, long double b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const long long maxN = 1e6 + 1000;
long long a[maxN], k[maxN];
long long n, m;
long long cnt(long long x) {
  long long pos = 0;
  for (long long i = 0; i < n; i++) {
    if (a[i] <= x) {
      pos++;
    }
  }
  for (long long i = 0; i < m; i++) {
    if (k[i] > 0) {
      if (k[i] <= x) {
        pos++;
      }
    } else {
      if (abs(k[i]) <= pos) {
        pos--;
      }
    }
  }
  return pos;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> n >> m;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i < m; i++) {
    cin >> k[i];
  }
  long long l = 0, r = 1e9;
  if (cnt(r) == 0) {
    cout << 0;
    return 0;
  }
  while (r - l > 1) {
    long long mid = (l + r) / 2;
    if (cnt(mid) > 0) {
      r = mid;
    } else {
      l = mid;
    }
  }
  cout << r;
  return 0;
}
