#include <bits/stdc++.h>
using namespace std;
template <typename T>
void print(T a) {
  for (auto x : a) cout << x << ' ';
  cout << endl;
}
const long long INF = 1e18;
long long n, q;
vector<long long> a;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> q;
  a.resize(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  vector<vector<long long> > go(n, vector<long long>(19, INF));
  vector<long long> last(19, -1);
  for (long long j = n - 1; j >= 0; j--) {
    for (long long i = 0; i < 19; i++) {
      if (!((a[j] >> i) & 1)) continue;
      if (last[i] == -1) continue;
      long long id = last[i];
      for (long long t = 0; t < 19; t++) go[j][t] = min(go[j][t], go[id][t]);
    }
    for (long long i = 0; i < 19; i++) {
      if ((a[j] >> i) & 1) {
        last[i] = j;
        go[j][i] = j;
      }
    }
  }
  for (long long i = 0; i < q; i++) {
    long long x, y;
    cin >> x >> y;
    x--;
    y--;
    bool ok = false;
    for (long long j = 0; j < 19; j++)
      if (go[x][j] <= y && ((a[y] >> j) & 1)) ok = true;
    cout << (ok ? "Shi" : "Fou") << '\n';
  }
  return 0;
}
