#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using ii = pair<ll, ll>;
ll n, q, a[300050], last[300050][22], d[300050][22], x, y;
int main() {
  cin.tie(nullptr);
  cout.tie(nullptr);
  ios::sync_with_stdio(false);
  cin >> n >> q;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < 20; i++) d[n][i] = n;
  for (int i = 0; i < 20; i++) {
    int p = 0;
    for (int j = 0; j < n; j++) {
      if (a[j] & (1 << i)) {
        for (; p < j; p++) {
          last[p][i] = j;
        }
      }
    }
    for (; p < n; p++) last[p][i] = n;
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < 20; j++) {
      d[i][j] = n;
      for (int k = 0; k < 20; k++) {
        if (a[i] & (1 << k)) {
          if (j == k)
            d[i][j] = i;
          else
            d[i][j] = min(d[i][j], d[last[i][k]][j]);
        }
      }
    }
  }
  for (int i = 0; i < q; i++) {
    cin >> x >> y;
    x--, y--;
    bool test = false;
    for (int j = 0; j < 20; j++) {
      test |= (((a[y] >> j) & 1) && d[x][j] <= y);
    }
    cout << (test ? "Shi" : "Fou") << '\n';
  }
  return 0;
}
