#include <bits/stdc++.h>
using namespace std;
auto Random_Address = [] {
  char* c;
  c = new char;
  delete c;
  return uint64_t(c);
};
uint64_t const SEED = chrono::steady_clock::now().time_since_epoch().count() *
                      (Random_Address() bitor 1);
mt19937 Rng(SEED);
constexpr int Mask(int i) { return 1 << i; }
constexpr int Getb(int x, int i) { return x >> i bitand 1; }
template <class X, class Y>
bool minimize(X& x, Y const& y) {
  return y < x ? x = y, 1 : 0;
}
template <class X, class Y>
bool maximize(X& x, Y const& y) {
  return y > x ? x = y, 1 : 0;
}
int main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  string const ans[2] = {"Shi", "Fou"};
  int N, Q;
  cin >> N >> Q;
  vector<int> a(N);
  int maxbit = 0;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    maximize(maxbit, 32 - __builtin_clz(a[i]));
  }
  vector<vector<int>> nxt(N, vector<int>(maxbit, N)),
      lst(N, vector<int>(maxbit, N));
  for (int i = N - 1; i >= 0; i--) {
    for (int j = 0; j < maxbit; j++) {
      if (i + 1 < N) lst[i][j] = lst[i + 1][j];
      if (Getb(a[i], j) and lst[i][j] < N)
        for (int k = 0; k < maxbit; k++)
          nxt[i][k] = min(nxt[i][k], nxt[lst[i][j]][k]);
    }
    for (int j = 0; j < maxbit; j++)
      if (Getb(a[i], j)) nxt[i][j] = lst[i][j] = i;
  }
  for (int _ = 0; _ < Q; _++) {
    int x, y;
    cin >> x >> y;
    --x;
    --y;
    bool flag = false;
    for (int i = 0; i < maxbit; i++)
      if (Getb(a[y], i) and nxt[x][i] <= y) flag = true;
    cout << ans[not flag] << '\n';
  }
  return 0;
}
