#include <bits/stdc++.h>
using namespace std;
const int MAX = 3e5 + 50;
int n, q;
const int lg = 18;
int a[MAX], des[MAX][20];
int fin[MAX];
int main() {
  cin >> n >> q;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 0; i <= lg; i++) {
    fin[i] = n + 1;
    des[n + 1][i] = n + 1;
  }
  for (int i = n; i >= 1; i--) {
    for (int j = 0; j <= lg; j++) des[i][j] = n + 1;
    for (int j = 0; j <= lg; j++) {
      if ((a[i] >> j) & 1) {
        for (int k = 0; k <= lg; k++) {
          des[i][k] = min(des[i][k], des[fin[j]][k]);
        }
        fin[j] = i;
        des[i][j] = i;
      }
    }
  }
  while (q--) {
    int x, y;
    cin >> x >> y;
    bool ans = 0;
    for (int i = 0; i <= lg; i++) {
      ans |= (((a[y] >> i) & 1) && des[x][i] <= y);
    }
    cout << (ans ? "Shi" : "Fou") << endl;
  }
}
