#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
const int N = 3e5 + 5, LG = 19;
vector<int> offq[N];
pii qs[N];
int v[N], best[LG], reach[LG][LG];
bool ant[N];
int n, q;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> n >> q;
  for (int i = 1; i <= n; ++i) cin >> v[i];
  for (int i = 1; i <= q; ++i) {
    cin >> qs[i].first >> qs[i].second;
    offq[qs[i].second].push_back(i);
  }
  for (int pos = 1; pos <= n; ++pos) {
    for (int i = 0; i < LG; ++i) {
      best[i] = 0;
      if (v[pos] & (1 << i)) reach[i][i] = pos;
    }
    for (int i = 0; i < LG; ++i)
      if (v[pos] & (1 << i))
        for (int j = 0; j < LG; ++j) best[j] = max(best[j], reach[i][j]);
    for (int i = 0; i < LG; ++i)
      if (v[pos] & (1 << i))
        for (int j = 0; j < LG; ++j) reach[i][j] = best[j];
    for (const auto &q : offq[pos]) {
      int l = qs[q].first, r = qs[q].second, bnd = 0;
      for (int i = 0; i < LG; ++i)
        if (v[r] & (1 << i))
          for (int j = 0; j < LG; ++j)
            if (v[l] & (1 << j)) bnd = max(bnd, reach[i][j]);
      ant[q] = (bnd >= l);
    }
  }
  for (int i = 1; i <= q; ++i) cout << (ant[i] ? "Shi" : "Fou") << '\n';
  return 0;
}
