#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, q;
  cin >> n >> q;
  vector<int> a(n + 1);
  for (int i = (1); i < (n + 1); i++) cin >> a[i];
  vector<bool> res(q);
  vector<vector<pair<int, int>>> qat(n + 1);
  for (int i = (0); i < (q); i++) {
    int x, y;
    cin >> x >> y;
    qat[y].emplace_back(x, i);
  }
  const int K = 20;
  vector<vector<int>> dp(n + 1, vector<int>(K));
  vector<int> next_with(K);
  for (int i = (1); i < (n + 1); i++) {
    for (int k = (0); k < (K); k++)
      if (a[i] & (1 << k)) {
        int j = next_with[k];
        for (int l = (0); l < (K); l++) dp[i][l] = max(dp[i][l], dp[j][l]);
      }
    for (int k = (0); k < (K); k++)
      if (a[i] & (1 << k)) {
        next_with[k] = i;
        dp[i][k] = i;
      }
    for (pair<int, int> p : qat[i]) {
      int j, id;
      tie(j, id) = p;
      for (int k = (0); k < (K); k++)
        if (a[j] & (1 << k)) {
          if (dp[i][k] >= j) res[id] = true;
        }
    }
  }
  for (int i = (0); i < (q); i++) cout << (res[i] ? "Shi" : "Fou") << "\n";
}
