#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const long long LINF = INF * (long long)INF;
const int MAX = 3 * 1000 * 100 + 47;
const int MIN = 20;
int A[MAX];
int N[MAX][MIN];
int L[MAX][MIN];
int n;
bool can(int x, int y) {
  for (int j = (0); j < (MIN); j++) {
    if (L[x][j] <= y && (A[y] & (1 << j))) return true;
  }
  return false;
}
void preCalc() {
  for (int j = (0); j < (MIN); j++) {
    N[n - 1][j] = n;
    L[n - 1][j] = n;
    if (A[n - 1] & (1 << j)) {
      N[n - 1][j] = n - 1;
      L[n - 1][j] = n - 1;
    }
  }
  for (int i = (n - 1) - 1; i >= (0); i--) {
    for (int j = (0); j < (MIN); j++) {
      N[i][j] = N[i + 1][j];
      if (A[i] & (1 << j)) {
        N[i][j] = i;
      }
    }
  }
  for (int i = (n - 1) - 1; i >= (0); i--) {
    for (int j = (0); j < (MIN); j++) {
      L[i][j] = n;
      if (A[i] & (1 << j)) {
        L[i][j] = i;
        continue;
      }
      for (int k = (0); k < (MIN); k++) {
        if (A[i] & (1 << k)) {
          int pos = N[i + 1][k];
          if (pos == n) continue;
          L[i][j] = min(L[i][j], L[pos][j]);
        }
      }
    }
  }
}
bool brute(int x, int y) {
  vector<int> U(n, 0);
  queue<int> q;
  q.push(x);
  U[x] = 1;
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (int i = (v); i < (n); i++) {
      if ((A[i] & A[v]) && !U[i]) {
        U[i] = 1;
        q.push(i);
      }
    }
  }
  return U[y];
}
void gen() {
  n = rand() % 100 + 1;
  for (int i = (0); i < (n); i++) {
    A[i] = rand() % 100;
  }
}
void print() {
  cout << n << endl;
  for (int i = (0); i < (n); i++) {
    cout << A[i] << " ";
  }
  cout << endl;
  for (int i = (0); i < (n); i++) {
    for (int j = (0); j < (MIN); j++) {
      int bit = (A[i] & (1 << j)) ? 1 : 0;
      cout << bit;
    }
    cout << endl;
  }
}
void stress() {
  while (1) {
    gen();
    int x = rand() % n;
    int y = rand() % n;
    if (x == y) continue;
    cout << "*" << endl;
    if (x > y) swap(x, y);
    int br = brute(x, y);
    preCalc();
    int sol = can(x, y);
    if (br != sol) {
      cout << "brute=" << br << endl;
      cout << "solution=" << sol << endl;
      print();
      cout << x + 1 << " " << y + 1 << endl;
      exit(0);
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int q;
  cin >> n >> q;
  for (int i = (0); i < (n); i++) cin >> A[i];
  preCalc();
  for (int i = (0); i < (q); i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    if (can(x, y)) {
      cout << "Shi"
           << "\n";
      continue;
    }
    cout << "Fou"
         << "\n";
  }
  return 0;
}
