#include <bits/stdc++.h>
using namespace std;
int n, m, a[1000009], c[1000009], b[1000009], tot, pos[1000009], cc;
bool vis[1000009];
void update(int x, int v) {
  while (x < 1000009) {
    c[x] += v;
    x += x & -x;
  }
}
int find_kth(int k) {
  int ans = 0, cnt = 0;
  for (int i = 20; i >= 0; i--) {
    ans += (1 << i);
    if (ans >= 1000009 || cnt + c[ans] >= k)
      ans -= (1 << i);
    else
      cnt += c[ans];
  }
  return ans + 1;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) scanf("%d", &a[i]);
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    if (x == -1) {
      cc = 0;
      for (int i = 1; i <= m && a[i] <= cnt; i++) pos[cc++] = find_kth(a[i]);
      for (int i = 0; i < cc; i++) {
        vis[pos[i]] = 1;
        update(pos[i], -1);
      }
      cnt -= cc;
    } else if (x == 0) {
      b[++tot] = 0;
      update(tot, 1);
      cnt++;
    } else {
      b[++tot] = 1;
      update(tot, 1);
      cnt++;
    }
  }
  if (!cnt) {
    puts("Poor stack!");
  } else {
    for (int i = 1; i <= tot; i++) {
      if (!vis[i]) {
        printf("%d", b[i]);
      }
    }
    puts("");
  }
  return 0;
}
