#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
int n, q, a[maxn], k[maxn];
bool check(int x) {
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    cnt += (x >= a[i]);
  }
  for (int i = 1; i <= q; i++) {
    if (k[i] < 0) {
      cnt -= (cnt >= -k[i]);
    } else {
      cnt += (x >= k[i]);
    }
  }
  return cnt > 0;
}
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i <= q; i++) {
    scanf("%d", &k[i]);
  }
  int l = 1, r = 1e6, ans = 0;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (check(mid)) {
      ans = mid;
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  printf("%d\n", ans);
  return 0;
}
