#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3fLL;
const double PI = acos(-1.0);
const double eps = 1e-8;
const int mod = 1e9 + 7;
const int N = 3e5 + 5;
const int M = N * 100;
const int maxn = 1e7 + 50;
int n, q;
int a[N];
int nxt[N][21];
int tran[21][21];
int L[21];
const int DEG = 20;
void work() {
  cin >> n >> q;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  memset(tran, inf, sizeof(tran));
  memset(L, inf, sizeof(L));
  for (int i = n - 1; i >= 0; --i) {
    memset(nxt[i], inf, sizeof(nxt[i]));
    for (int j = 0; j < DEG; ++j) {
      if ((1 << j) & a[i]) {
        nxt[i][j] = min(nxt[i][j], L[j]);
        for (int k = 0; k < DEG; ++k) {
          nxt[i][k] = min(nxt[i][k], tran[j][k]);
        }
        L[j] = min(L[j], i);
      }
    }
    for (int j = 0; j < DEG; ++j) {
      if ((1 << j) & a[i]) {
        for (int k = 0; k < DEG; ++k) {
          tran[j][k] = min(tran[j][k], nxt[i][k]);
        }
      }
    }
  }
  while (q--) {
    int x, y;
    cin >> x >> y;
    --x;
    --y;
    int u = a[x], v = a[y];
    bool ans = false;
    for (int j = 0; j < DEG; ++j) {
      if ((1 << j) & v) {
        if (nxt[x][j] <= y) {
          ans = true;
        }
      }
    }
    if (ans) {
      cout << "Shi\n";
    } else {
      cout << "Fou\n";
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  work();
  return 0;
}
