#include <bits/stdc++.h>
using namespace std;
constexpr int B = 19;
void minf(vector<int>& v1, vector<int>& v2) {
  assert(v1.size() == v2.size());
  for (int i = 0; i < v1.size(); ++i) {
    v1[i] = min(v1[i], v2[i]);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, q;
  cin >> n >> q;
  vector<int> a(n);
  vector<vector<int>> idx(B), suf(n, vector<int>(B, n));
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int i = n - 1; i >= 0; --i) {
    for (int j = 0; j < B; ++j) {
      if (a[i] >> j & 1) {
        suf[i][j] = i;
        if (idx[j].size()) {
          minf(suf[i], suf[idx[j].back()]);
        }
        idx[j].push_back(i);
      }
    }
  }
  while (q--) {
    int x, y;
    cin >> x >> y;
    --x;
    --y;
    bool ok = false;
    for (int j = 0; j < B && !ok; ++j) {
      if (a[y] >> j & 1) {
        if (suf[x][j] <= y) {
          ok = true;
        }
      }
    }
    cout << (ok ? "Shi" : "Fou") << '\n';
  }
}
