#include <bits/stdc++.h>
using namespace std;
int main() {
  const int MAX = 300000;
  int log_MAX = 0;
  while ((1 << log_MAX) < MAX) log_MAX++;
  int n, q;
  cin >> n >> q;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  vector<vector<int> > last(n + 1, vector<int>(log_MAX, n));
  vector<vector<int> > dp(n + 1, vector<int>(log_MAX, n));
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < log_MAX; j++) {
      last[i][j] = last[i + 1][j];
      if ((i < n - 1) && (v[i + 1] & (1 << j))) last[i][j] = i + 1;
    }
    for (int j = 0; j < log_MAX; j++) {
      if ((1 << j) & v[i]) {
        for (int k = 0; k < log_MAX; k++) {
          dp[i][k] = min(dp[i][k], dp[last[i][j]][k]);
        }
        dp[i][j] = i;
      }
    }
  }
  while (q--) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    bool reach = false;
    for (int j = 0; j < log_MAX; j++) {
      if ((v[y] >> j) & 1 && (dp[x][j] <= y)) {
        reach = true;
        break;
      }
    }
    cout << (reach ? "Shi" : "Fou") << endl;
  }
  return 0;
}
