#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<long long>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;
template <class T>
inline bool ckmin(T& a, T b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
inline bool ckmax(T& a, T b) {
  return b > a ? a = b, 1 : 0;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const char nl = '\n';
const int mxN = 300069;
const int LOG = 22;
const int MOD = 1e9 + 7;
const long long infLL = 1e18;
int n, q;
int a[mxN];
int dp[mxN][LOG];
int lst[LOG];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> q;
  for (int i = (0); i < (n); i++) cin >> a[i];
  for (int i = (0); i < (LOG); i++) {
    lst[i] = n;
  }
  for (int i = (n - 1); i >= (0); i--) {
    for (int j = (0); j < (LOG); j++) {
      dp[i][j] = n;
    }
    for (int j = (0); j < (LOG); j++) {
      if (a[i] & (1 << j)) {
        int pos = lst[j];
        lst[j] = i;
        if (pos == n) {
          continue;
        }
        dp[i][j] = min(dp[i][j], pos);
        for (int k = (0); k < (LOG); k++) {
          ckmin(dp[i][k], dp[pos][k]);
        }
      }
    }
  }
  while (q--) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    bool ok = 0;
    for (int j = (0); j < (LOG); j++) {
      if (a[y] & (1 << j)) {
        if (dp[x][j] <= y) {
          ok = 1;
        }
      }
    }
    cout << (ok ? "Shi" : "Fou") << nl;
  }
  return 0;
}
