#include <bits/stdc++.h>
using namespace std;
const int MAXN = ((int)3e5) + 1;
const int B = 20;
const int INF = 1e9;
int n, a[MAXN];
int nxt[MAXN][B];
string ans;
int main() {
  ios_base::sync_with_stdio(0);
  int q;
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  vector<int> lst(B, INF);
  for (int i = n; i > 0; i--) {
    for (int b = 0; b < B; b++) {
      if (a[i] & (1 << b))
        nxt[i][b] = i;
      else
        nxt[i][b] = INF;
      for (int c = 0; c < B; c++) {
        if ((a[i] & (1 << c)) && lst[c] <= n) {
          nxt[i][b] = min(nxt[i][b], nxt[lst[c]][b]);
        }
      }
    }
    for (int b = 0; b < B; b++) {
      if (a[i] & (1 << b)) lst[b] = i;
    }
  }
  int l, r;
  while (q--) {
    cin >> l >> r;
    bool ok = 0;
    for (int b = 0; b < B; b++) {
      if ((a[r] & (1 << b)) && nxt[l][b] <= r) ok = 1;
    }
    ans += ok ? "Shi\n" : "Fou\n";
  }
  cout << ans;
  return 0;
}
