#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 100;
int a[N];
int dp[N][20];
int last[20];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, q;
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    for (int k = 0; k < 20; k++) {
      if ((a[i] >> k) & 1) {
        dp[i][k] = i;
      }
      for (int l = 0; l < 20; l++) {
        if ((a[i] >> l) & 1) dp[i][k] = max(dp[last[l]][k], dp[i][k]);
      }
    }
    for (int k = 0; k < 20; k++) {
      if ((a[i] >> k) & 1) {
        last[k] = i;
      }
    }
  }
  while (q--) {
    int x, y;
    cin >> x >> y;
    int rgt = 0;
    for (int k = 0; k < 20; k++) {
      if ((a[x] >> k) & 1) {
        rgt = max(rgt, dp[y][k]);
      }
    }
    if (rgt >= x) {
      cout << "Shi"
           << "\n";
    } else {
      cout << "Fou"
           << "\n";
    }
  }
  return 0;
}
