#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
struct edge {
  int v, nxt;
} g[N * 20];
int head[N], sz = 0;
void add(int u, int v) {
  g[++sz] = {v, head[u]};
  head[u] = sz;
}
int n, q, a[N], f[N][20];
int main() {
  scanf("%d%d", &n, &q);
  for (long long i = (1); i <= (n); i++) scanf("%d", a + i);
  int lst;
  for (long long j = (0); j <= (19); j++) {
    lst = 0;
    for (long long i = (1); i <= (n); i++)
      if (a[i] & (1 << j)) {
        if (lst) add(i, lst);
        lst = i;
      }
  }
  for (long long u = (1); u <= (n); u++) {
    for (long long j = (0); j <= (19); j++) {
      f[u][j] = (a[u] & (1 << j)) ? u : -1;
      for (int i = head[u]; i; i = g[i].nxt) {
        int v = g[i].v;
        f[u][j] = max(f[u][j], f[v][j]);
      }
    }
  }
  for (long long i = (1); i <= (q); i++) {
    int l, r;
    scanf("%d%d", &l, &r);
    bool flg = 0;
    for (long long j = (0); j <= (19); j++)
      if (a[l] & (1 << j)) flg |= (f[r][j] >= l);
    printf(flg ? "Shi\n" : "Fou\n");
  }
}
