#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, q;
  cin >> n >> q;
  long long int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  int Next[n][32];
  for (int i = 0; i < 32; i++) Next[n - 1][i] = n;
  for (int i = n - 1; i > -1; i--) {
    for (int j = 0; j < 32; j++) {
      if ((arr[i] & (1 << j)) > 0) {
        Next[i - 1][j] = i;
      } else {
        Next[i - 1][j] = Next[i][j];
      }
    }
  }
  int reach[n][32];
  for (int i = n - 1; i > -1; i--) {
    for (int j = 0; j < 32; j++) {
      reach[i][j] = n;
      for (int k = 0; k < 32; k++) {
        if ((arr[i] & (1 << k)) > 0 && Next[i][k] < n) {
          reach[i][j] = min(reach[i][j], reach[Next[i][k]][j]);
          if (j == k) {
            reach[i][j] = min(reach[i][j], Next[i][k]);
          }
        }
      }
    }
  }
  while (q--) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    bool b = false;
    for (int j = 0; j < 32; j++) {
      if (reach[x][j] <= y && (arr[y] & (1 << j)) > 0) {
        b = true;
      }
    }
    if (b)
      cout << "Shi" << endl;
    else
      cout << "Fou" << endl;
  }
  return 0;
}
